Skip to main content

CutoverError

Enum CutoverError 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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.

Fields

§path: PathBuf
§reason: &'static str
§

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.

Fields

§participant: String
§path: PathBuf
§

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.

Fields

§

ReopenPending

The switch is durable (the new root is the authority) but a participant could not reopen. Run RootCutover::recover; hooks are idempotent.

Fields

§name: String
§generation: u64
§

SettlementPending

New root remains authoritative; durable participant cleanup must be retried.

Fields

§generation: u64
§

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for CutoverError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for CutoverError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for CutoverError

Source§

fn from(e: Error) -> Self

Converts to this type from the input type.
Source§

impl From<FsError> for CutoverError

Source§

fn from(e: FsError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.