Command records signal operations that are interpreted by the service. S2 SDKs and the CLI make it easy to create supported command records, so most applications do not need to construct them directly. Concretely, a command record is a record with:Documentation Index
Fetch the complete documentation index at: https://s2.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
- A single header with an empty name. Empty header names are not allowed in any other context.
- The operation encoded in that header value.
- The command payload in the record body.
Command records take up a sequence number on the stream, and will be returned to reads. It is easy to test and filter out commands if needed, with the logic
len(headers) == 1 && headers[0].name == b"".Operations
Operations that are currently supported:fence— set a fencing token for cooperative write exclusion. Payload is up to 36 UTF-8 bytes; an empty payload clears the token.trim— set a trim point to remove older records. Payload is exactly 8 big-endian bytes representing the desired earliest sequence number.
Constructing command records via REST
Constructing command records via REST
- fence
- trim
See also
Concurrency control
Coordinate writers with match sequence numbers and fencing tokens.
Trimming
Discard older records by setting a stream trim point.
Appends
Understand append acknowledgements, batching, and durability.

