Expand description
Writes that settle an unknown outcome by reading the position back.
A store answers DurabilityError::OutcomeUnknown for a write it had
started when its caller stopped waiting: the write may have been applied.
It is never “not written”. Each helper here performs one write and, on that
answer, reads the position the write targeted, as
super::channel’s pending append is resolved: the caller’s own bytes
standing there mean the write landed and its result is returned; nothing
standing there means it had not landed yet, and the write is sent once
more; anything else is the conflict it would have met. The first write may
still land after that read, so a resend that meets a conflict reads the
position once more, and the caller’s own bytes there mean applied, never a
conflict. When a read fails, the original
DurabilityError::OutcomeUnknown is returned, so the caller still meets
it by name.
Every write the store offers is guarded by the position it expects (a sequence, or a swap’s old value), so a resend can never duplicate a row: the guard refuses it once the first write stands.
Functions§
- append_
all_ settled - Appends
payloadsfromexpected_seqin one write, settling an unknown outcome. Answers the sequence after the last row. - append_
settled - Appends
payloadatexpected_seq, settling an unknown outcome. - apply_
routed_ batch_ settled - Applies one routed batch and settles an unknown outcome by reading every key the batch targeted.
- apply_
routed_ entries_ settled - Applies one routed batch of puts and deletes and settles an unknown outcome by reading every key the batch targeted (DUR-028 R3).
- cas_
settled - Swaps
keyfromold_valuetonew_value, settling an unknown outcome. - flush_
settled - Flushes once, preserving any failure as an unconfirmed durability barrier.