pub struct Pending<'a> { /* private fields */ }Expand description
A streaming append in progress. See Log::begin.
Dropped without Pending::commit or Pending::abort, it aborts (twin-streaming,
2026-10-06). The partial frame is already in the segment file, and the writer appends with
O_APPEND: before this, a ? between begin and commit (a write that failed, a wire that
broke under a twin’s fetch) left the half frame where it was, the next append landed AFTER
it while the index recorded the offset BEFORE it, and every read of that next frame was a
corrupt header — a log broken by one failed transfer. Now the half frame is cut off the
segment on every path out, and a partial transfer leaves exactly nothing.
Implementations§
Source§impl Pending<'_>
impl Pending<'_>
Sourcepub fn commit(self) -> Result<u64>
pub fn commit(self) -> Result<u64>
Finish: trailer, fsync, index. Durable when this returns — and so is every frame of a
group committed before it (Pending::commit_unsynced).
Sourcepub fn commit_unsynced(self) -> Result<u64>
pub fn commit_unsynced(self) -> Result<u64>
Finish WITHOUT making it durable — one frame of a group commit (perf twin-apply-fsync,
2026-10-06). The frame is whole in the segment (staged or written, trailer and all), it
holds its sequence number — the next begin takes the one after — but it is not fsynced,
not indexed, not visible to readers and not the head until Log::sync (or any synced
append, roll or release) makes the whole group durable with ONE fdatasync.
A crash before that loses the group’s tail, never anything acknowledged: open keeps
every whole frame that reached the disk (each checks its own crc) and cuts the rest, and a
twin re-fetches from its durable head.