Skip to content

Cumulative acks

An acknowledgement in Xratu is cumulative: it confirms everything up to and including a sequence, not one item. An acknowledgement names only a sequence up to which the node has received every envelope.

This page covers the rule on the kernel return lane, the equivalent on the status lane, and what the peer is entitled to do once it has been acknowledged.

What an acknowledgement licenses

flowchart TB
  subgraph KERN["PROJECT KERNEL"]
    direction TB
    STORE[("Continuity store<br/>envelopes and lane cursor")]
    COMP["Compaction of acknowledged envelopes"]
    STORE --> COMP
  end
  subgraph NODE["DATA PLANE NODE"]
    direction TB
    CUR[("Return cursor<br/>last_acked_seq")]
    CHK{{"Proposal at or under<br/>the reported maximum?"}}
    CHK -->|"yes"| CUR
  end
  STORE -->|"envelopes from last_acked_seq"| CHK
  CUR -->|"acknowledgement"| COMP

The kernel removes what the node has confirmed, in Compaction of acknowledged envelopes. An acknowledgement therefore stops at the first gap, and the envelopes past it stay in the continuity store until the node has received them.

The acknowledgement rules

A proposal is checked against four conditions, in order:

Verdict Condition Accepted Retryable
regression The proposal is behind the current position No No
post_terminal The session has a terminal sequence and the proposal is past it No No
gap The proposal is past the maximum sequence the kernel reported No No
accepted None of the three Yes No

Every refusal is deterministic and not retryable: the same proposal meets the same condition on every attempt. An accepted verdict takes the position to the greater of the current value and the proposal, so an accepted acknowledgement never lowers it.

The verdict is a kernel.return_ack.v1 document:

{
  "contract_version": "kernel.return_ack.v1",
  "accepted": false,
  "state": "gap",
  "last_acked_seq": 4190,
  "error_class": "deterministic",
  "retryable": false,
  "retry_after_seconds": 0
}

last_acked_seq on a refusal is the position that stands, and the next drain resumes from it.

Five states refuse an acknowledgement

gap            the proposal is past what the kernel reported available
regression     the proposal is behind the position already held
post_terminal  the proposal is past the session's terminal sequence
non_owner      the caller is not the current owner of this runtime instance
stale_fence    the caller's fence epoch has been superseded

The last two are ownership refusals, and they stop the reconnect as well, so a fenced session is never re-established and one runtime keeps one owner. See Ownership handover across a break.

The same rule on the status lane

The status acknowledgement watermark is cumulative in the same way. When the control plane accepts a status envelope, that envelope's global enqueue sequence becomes the watermark, and compaction then removes every acknowledged record at or under it.

The watermark is measured in the node's own enqueue order, and records are only removed once they carry acked, so an unacknowledged envelope with a lower sequence stays even when a later one has been confirmed. See The status ack cursor.

Replay starts at the position

A replay request names the position and a limit:

from_seq   the last acknowledged sequence
limit      between 1 and 1000, defaulting to 100

A request from the position delivers the envelopes between what was confirmed and what the kernel holds. See Resume direction.