pub struct GroupCommit { /* private fields */ }Expand description
Group-commit coordinator (spec §9.3). The commit sequencer appends a txn’s
records under the WAL mutex but does not fsync there; instead each
committer calls Self::await_durable with its commit record’s WAL seq.
Exactly one waiter becomes the leader and issues a single group_sync
(fsync), which makes durable every record appended up to that point; the
others are followers that simply wait until durable_seq reaches their
commit seq. One fsync therefore covers a whole batch of concurrent commits.
Implementations§
Source§impl GroupCommit
impl GroupCommit
pub fn new(durable_seq: u64) -> Self
Sourcepub fn await_durable(
&self,
wal: &PlMutex<SharedWal>,
commit_seq: u64,
) -> Result<()>
pub fn await_durable( &self, wal: &PlMutex<SharedWal>, commit_seq: u64, ) -> Result<()>
Block until commit_seq is durable. The first eligible caller fsyncs on
behalf of the batch; the rest wait on the condvar. On fsync error the
coordinator is poisoned and every waiter (current and future) returns
Err (spec §9.3e). wal is the same SharedWal the sequencer appended
to — locked here only for the brief fsync, never across the wait.
Auto Trait Implementations§
impl !Freeze for GroupCommit
impl !RefUnwindSafe for GroupCommit
impl Send for GroupCommit
impl Sync for GroupCommit
impl Unpin for GroupCommit
impl UnsafeUnpin for GroupCommit
impl UnwindSafe for GroupCommit
Blanket Implementations§
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> 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