Skip to content

Why the data plane keeps cursors

A data plane node takes part in streams that continue while the node restarts, is replaced on a new image or loses its link to the control plane. A cursor is the node's recorded position in one of those streams.

Four positions exist, in three lanes. Each is advanced by a different authority and confirmed by a different peer, so the node keeps four records.

The four positions

Position Lane Answers
Assignment watch Control plane to node How far through the assignment stream the node has read, stored, applied and confirmed
Status acknowledgement Node to control plane Which status envelopes the control plane has accepted
Telemetry outbox checkpoint Node to control plane Which spooled records are still waiting, and in which segment
Kernel return sequence Kernel to node The last return-lane sequence the node acknowledged, per project runtime

The first two concern authority: what work the node was given, and what the control plane knows about it. The third concerns delivery. The fourth concerns evidence coming back from execution.

The lanes a position sits in

flowchart TB
  subgraph CP["CONTROL PLANE"]
    direction TB
    LEDGER[("Assignment ledger<br/>stream revision")]
    INGEST["Status and telemetry ingest"]
  end
  subgraph NODE["DATA PLANE NODE"]
    direction TB
    WC[("Assignment watch cursor<br/>four revisions")]
    SA[("Status ack state<br/>ack watermark")]
    OB[("Outbox checkpoint<br/>per channel")]
    KR[("Kernel return cursor<br/>per runtime instance")]
  end
  subgraph KERN["PROJECT KERNEL"]
    direction TB
    CONT[("Continuity store<br/>envelopes and lane cursor")]
  end
  LEDGER -->|"assignments after the cursor"| WC
  SA -->|"status envelopes"| INGEST
  OB -->|"spooled records"| INGEST
  CONT -->|"sequenced envelopes"| KR

The node holds one record per lane. Assignment ledger moves the inbound position, Status and telemetry ingest confirms the two outbound ones, and the kernel's Continuity store is the authority for the return sequence.

What a recorded position prevents

A recorded position lets a restarted node continue from where it was. Where it resumes relative to the true position decides the outcome:

resume behind the true position   work is repeated, and dedupe absorbs it
resume at the true position       work continues
resume ahead of the true position work is skipped, with no record that it existed

The idempotency records the node keeps absorb repeated work. Skipped work leaves no record, so every position advances only on evidence from a peer. See Resume direction and Idempotency and replay-safe reprocessing.

When a position advances

One rule governs all four positions. A position advances when a peer has confirmed the thing the advance claims, and the claim is checked against what the peer reported available:

Position Advances when
Assignment watch The control plane returns a higher stream revision
Status acknowledgement The control plane accepts a staged envelope, and the watermark rises to that envelope's enqueue sequence
Telemetry outbox checkpoint A batch is accepted and its records are deleted from the segment
Kernel return sequence The kernel's proposed next sequence passes the acknowledgement rules against its reported maximum

A failed watch returns the position unchanged. A refused batch raises an attempt count and leaves the record in place. A proposed return sequence past the kernel's reported maximum is refused as a gap. See Gap handling and Cumulative acks.

Where the truth lives when the record is gone

One of the four records, the assignment watch cursor, is written to the node's volume and survives a restart. Three belong to the process, and their truth is at the source: the control plane's assignment ledger holds lease and status truth, and the kernel's continuity store holds evidence and the lane cursor. See Durable node state layout and Cursor separation.