pub struct MigrationConfig {
pub enabled: bool,
pub dual_write_legacy: bool,
pub allow_shed: bool,
pub retire_legacy: bool,
pub shed_hold_hours: u64,
pub retire_delay_hours: u64,
pub copier_slack_mb: u64,
pub copier_throttle_mib_per_sec: u64,
pub wave_hours: u64,
pub tick_secs: u64,
pub batch_chunks: usize,
pub lock_dir: Option<PathBuf>,
}Expand description
Operator-facing controls for the migration.
Fields§
§enabled: boolRun the background copier at all.
Turning this off leaves a node reading the union of both stores forever. It never frees the LMDB’s disk, so it is an escape hatch rather than a supported mode.
dual_write_legacy: boolWrite every new chunk to the legacy environment as well as the file store.
Costs roughly a gigabyte per node per month at the observed fill rate, and buys the ability to roll the fleet back: a chunk uploaded during the bridge to holders that all revert to a pre-migration build would otherwise be gone from every one of them. Automatically irrelevant once the legacy environment is retired.
allow_shed: boolAllow a node that cannot fit its payload to drop its furthest keys.
An operator who would rather add disk than shed can set this to false. The node
then keeps both stores and never frees the LMDB’s space.
retire_legacy: boolDelete chunks.mdb once the retirement gate is satisfied.
On in this release, because it is the only step that returns disk. It is also the only destructive step in the whole migration and the only one that cannot be undone, which is why everything in front of it is a gate: the wave the node is assigned to, the shed hold, the reduced commitment reaching the close group, possession of every chunk being given up proven elsewhere, a re-read of every remaining chunk, and a retention delay on top.
Deliberately never serialised. A node writes its effective configuration back to
disk, so shipping this as an ordinary field would bake R1’s false into every
operator’s config file and R2 would then never retire anything. The release phase
belongs to the build, not to the operator’s file. ANT_MIGRATION_RETIRE_LEGACY
overrides it for a canary.
shed_hold_hours: u64Hours after this build first starts before a node may shed anything.
Long enough for peers still on a pre-R1 build to upgrade, because one of those still penalises a shedder at the full audit weight.
retire_delay_hours: u64Hours between committing to the file-backed key set and deleting chunks.mdb.
Clamped up to MIN_RETIRE_DELAY_HOURS. Longer buys a rollback window on nodes
that can afford to hold both copies.
copier_slack_mb: u64Free megabytes the copier leaves untouched, on top of the disk reserve.
The copier stops here rather than filling to the brink, so a node that is mid-migration still has room to accept a chunk it is paid for.
copier_throttle_mib_per_sec: u64Copy rate ceiling, in mebibytes per second.
The quiet responsible audit lane is where audit timeouts actually cost trust, and an unthrottled copier competing with it for I/O is the fastest way to turn a storage migration into an audit incident.
wave_hours: u64Hours between one migration wave opening and the next.
A close group is split into waves so that only
CONCURRENT_MIGRATIONS_PER_GROUP of it give chunks up at a time. This is how
long a wave gets to finish copying, retiring and refetching before the next one may
start. Only nodes that have to give something up wait for their wave; a node with
room migrates immediately.
tick_secs: u64Seconds between copier ticks.
batch_chunks: usizeChunks copied per tick before yielding.
lock_dir: Option<PathBuf>Where the volume lock lives, overriding the filesystem this node’s root sits on.
None in production, which keys the lock by device id so every node on one disk
serialises against the others. Tests set it so a test’s migration contends only
with its own, rather than with every other test sharing the machine’s filesystem.
Never serialised: it exists to scope a test, not to configure a node.
Implementations§
Source§impl MigrationConfig
impl MigrationConfig
Sourcepub fn effective_retire_delay_hours(&self) -> u64
pub fn effective_retire_delay_hours(&self) -> u64
The retire delay, never shorter than the retention contract allows.
Sourcepub fn copier_slack_bytes(&self) -> u64
pub fn copier_slack_bytes(&self) -> u64
Copier slack in bytes.
Trait Implementations§
Source§impl Clone for MigrationConfig
impl Clone for MigrationConfig
Source§impl Debug for MigrationConfig
impl Debug for MigrationConfig
Source§impl Default for MigrationConfig
impl Default for MigrationConfig
Source§impl<'de> Deserialize<'de> for MigrationConfig
impl<'de> Deserialize<'de> for MigrationConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for MigrationConfig
impl RefUnwindSafe for MigrationConfig
impl Send for MigrationConfig
impl Sync for MigrationConfig
impl Unpin for MigrationConfig
impl UnsafeUnpin for MigrationConfig
impl UnwindSafe for MigrationConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<'de, T> BorrowedRpcObject<'de> for T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more