pub enum LockableContainer {
RefPointerIndex,
RefLog,
ReceivedIndex,
TrustPolicy,
}Expand description
One of the four containers RFC 102 Stage 6 Step 2 locks against concurrent writer/compactor races
(design-v1.md §15.8, ruled wide by the project owner over the developer’s own narrower lean):
the three genuine compaction targets, plus the ref log, whose own tearing exposure predates RFC 102
and is not caused by compaction, but is fixed here because the exclusion machinery being built for
compaction closes it for free. trust_key_container is deliberately absent – it never compacts,
and stays protected by the unchanged, repository-wide ActiveLock alone, the same as before this
stage.
derive(Ord) on a fieldless enum compares by declaration order, which is the one fixed total
lock order every multi-container acquisition sorts into (lock::acquire_container_locks,
design-v1.md §15.7’s deadlock ruling) – no call site can express an inverted order even by
accident, because sorting is structural, not a discipline to remember.
Variants§
RefPointerIndex
refs/containers/pointer-index-{a,b}.container – Stage 6 Step 1’s own generation-aware
target.
RefLog
refs/containers/log-{a,b}.container – never compacted (DC-38/DC-69), but shares the ref
pointer index’s write path (publication.rs) and the same unserialized-appender exposure.
ReceivedIndex
refs/containers/received-index-{a,b}.container – Stage 6 Step 1’s own generation-aware
target, and the container whose investigation (bundle.rs:270’s import_bundle, no lock at
all) is what surfaced this whole ruling.
TrustPolicy
trust/policy-{a,b}.container – Stage 6 Step 1’s own generation-aware target. Already
incidentally protected today by ActiveLock (trust.rs:88,144); gains its own dedicated lock
here anyway, per the owner’s decision that the lock is container-scoped, not repository-wide
(design-v1.md §15.7 decision 2) – so a prikk compact run on this container never contends
with unrelated ActiveLock holders (a commit, a seal) that never touch it.
Implementations§
Trait Implementations§
Source§impl Clone for LockableContainer
impl Clone for LockableContainer
Source§fn clone(&self) -> LockableContainer
fn clone(&self) -> LockableContainer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more