Skip to main content

Module settle

Module settle 

Source
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 payloads from expected_seq in one write, settling an unknown outcome. Answers the sequence after the last row.
append_settled
Appends payload at expected_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 key from old_value to new_value, settling an unknown outcome.
flush_settled
Flushes once, preserving any failure as an unconfirmed durability barrier.