#[non_exhaustive]pub enum CutoverError {
Show 20 variants
InvalidRoot {
path: PathBuf,
reason: &'static str,
},
BadParticipant(String),
BadCompanion(PathBuf),
OwnedPathConflict {
participant: String,
path: PathBuf,
},
Busy(PathBuf),
Collision(PathBuf),
PathSubstituted(PathBuf),
RecordMismatch(String),
RecordUnreadable(String),
PendingTransaction(String),
Participant {
name: String,
step: CutoverStep,
error: ParticipantError,
},
AbortIncomplete {
cause: Box<CutoverError>,
failures: Vec<(String, ParticipantError)>,
},
ReopenPending {
name: String,
error: ParticipantError,
generation: u64,
},
SettlementPending {
generation: u64,
failures: Vec<(String, ParticipantError)>,
},
Migrate(AppRootError),
Fs(FsError),
FsRecoveryRequired(String),
Undecided(Error),
NotCompleted(CutoverPhase),
Io(Error),
}Expand description
Why a cutover step failed.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidRoot
The old or new root cannot be used as given (missing, not a real directory, a symlink, not UTF-8, relative, or the two nest). Nothing was changed.
BadParticipant(String)
A participant name is empty, not plain, or used twice, or an owned path is not a plain relative path.
BadCompanion(PathBuf)
A companion path is not a plain relative path to a regular file in the old root.
Path syntax is checked before participant hooks; file existence and type are checked
at move time, after relocate. A failure then settles prepared participants as aborted.
OwnedPathConflict
A companion lies on a path a participant owns.
Busy(PathBuf)
Another process or thread is running a cutover for this root.
Collision(PathBuf)
A destination holds something other than what would be written. Nothing was overwritten.
PathSubstituted(PathBuf)
A root is no longer the directory (by file identity) that was recorded: it was replaced or moved while the cutover ran.
RecordMismatch(String)
The persisted record names other roots than this cutover.
RecordUnreadable(String)
The persisted record cannot be read or is of a newer version. Fails closed: the caller must not guess which root to open.
PendingTransaction(String)
A FileTransaction of an earlier run is retained and could not be resolved.
Participant
A participant hook failed before the switch; every prepared participant was settled as aborted and the old root is the authority.
AbortIncomplete
The cutover failed before the switch and at least one participant also failed to resume
(settle(Aborted)); those participants must be restarted by the app.
ReopenPending
The switch is durable (the new root is the authority) but a participant could not reopen.
Run RootCutover::recover; hooks are idempotent.
SettlementPending
New root remains authoritative; durable participant cleanup must be retried.
Migrate(AppRootError)
The tree migration failed or ended unusable.
Fs(FsError)
A file-system operation failed.
FsRecoveryRequired(String)
The companion transaction could not be decided in this process.
Undecided(Error)
The record write at the switch failed and what is on disk could not be read back. The
decision is unknown; participants stay quiesced. Run RootCutover::recover.
NotCompleted(CutoverPhase)
The cutover has not reached completed; old-root retirement remains forbidden.
Io(Error)
Trait Implementations§
Source§impl Debug for CutoverError
impl Debug for CutoverError
Source§impl Display for CutoverError
impl Display for CutoverError
Source§impl Error for CutoverError
impl Error for CutoverError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()