pub enum SyncPolicy {
EveryN(u32),
OnFlushOnly,
}Expand description
WAL fsync scheduling policy.
Variants§
EveryN(u32)
Flush and fsync after every N appended entries, on explicit flush,
and when the writer is dropped.
EveryN(1) is durability-by-default. Values greater than 1 opt into
group commit. EveryN(0) is normalized to EveryN(1) on open.
OnFlushOnly
Never fsync during append or drop; only explicit WalWriter::flush
fsyncs.
This is an explicit opt-in for benchmark parity and offline paths where durability is provided elsewhere. It is not the production default.
§selene-graph forces this for the committer WAL (v1.2 BRIEF 2)
When a WalWriter is owned by selene-graph’s single committer thread
(via SharedGraphBuilder::with_wal / SharedGraph::from_graph_with_wal /
recovery), the committer is the sole fsync caller: it appends a
contiguous run of commits with fsync deferred, then issues exactly one
WalWriter::flush per run as the fsync-before-publish barrier. To make
that the only fsync path, selene-graph overrides WalConfig::sync_policy
to OnFlushOnly before opening such a WAL, discarding any caller policy
(the fsync cadence is instead set by selene_graph::CommitBatching). A
WalWriter opened directly (outside selene-graph) still honors whatever
policy the caller passes — the override lives in selene-graph, not here.
Implementations§
Source§impl SyncPolicy
impl SyncPolicy
Sourcepub const fn as_every_n(self) -> Option<u32>
pub const fn as_every_n(self) -> Option<u32>
Return the EveryN threshold when this policy syncs on append.
Trait Implementations§
Source§impl Clone for SyncPolicy
impl Clone for SyncPolicy
Source§fn clone(&self) -> SyncPolicy
fn clone(&self) -> SyncPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SyncPolicy
Source§impl Debug for SyncPolicy
impl Debug for SyncPolicy
impl Eq for SyncPolicy
Source§impl PartialEq for SyncPolicy
impl PartialEq for SyncPolicy
Source§fn eq(&self, other: &SyncPolicy) -> bool
fn eq(&self, other: &SyncPolicy) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SyncPolicy
Auto Trait Implementations§
impl Freeze for SyncPolicy
impl RefUnwindSafe for SyncPolicy
impl Send for SyncPolicy
impl Sync for SyncPolicy
impl Unpin for SyncPolicy
impl UnsafeUnpin for SyncPolicy
impl UnwindSafe for SyncPolicy
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.