SessionService
Multiplexed bidirectional session.
One long-lived bidirectional stream carries many concurrent operations for a single client. The client fires a batch of requests into the stream; the server executes them concurrently and streams results back as independent cursors, tagged by request id, in completion order rather than send order. An interactive transaction rides the same session as one interleaved sub-thread alongside non-transactional requests, and change-stream subscriptions ride it too, delivered in batches within the credit the client grants. The session is sticky to the serving node for its lifetime. The unary query, transaction and change-stream RPCs remain for clients that cannot hold a stream; this stream carries the same messages and is what a driver uses by default.
Proto source
Methods
Session
Open a session. The client sends a stream of ClientFrames (queries and transaction-control operations); the server returns a stream of ServerFrames (cursor chunks and transaction acknowledgements), each tagged with the originating request_id so responses demultiplex out of order.
Transport: Server-streaming gRPC only (no HTTP transcoding)
Request: stream ClientFrame
| Field | Type | Description |
|---|---|---|
request_id | uint64 | Client-assigned, session-scoped correlation id. Every ServerFrame produced for this operation carries the same request_id, so a client demultiplexes concurrent responses and cursor chunks that arrive out of order. The client is responsible for keeping request_ids unique within a live session. |
execute | Execute | Run a query statement (autonomous or inside a transaction). |
begin | Begin | Open an interactive transaction; the server replies with a Begun(txid). |
commit | Commit | Commit an interactive transaction by its txid. |
rollback | Rollback | Roll back an interactive transaction by its txid. |
cancel | Cancel | Abort an in-flight request and close its cursor. |
configure | Configure | Read, and optionally change, this connection's settings. Answered with a ConnectionStatus carrying the settings now in effect. |
subscribe | Subscribe | Open a change-stream subscription on this session. Answered with Subscribed, then with ChangeEventBatch frames on this request_id as far as the credit granted reaches. |
credit | Credit | Grant a subscription of this session credit for more events. |
acknowledge | AcknowledgeSubscriptionRequest | Acknowledge a subscription's events, with the same meaning as the change-stream service's AcknowledgeSubscription. Answered with Acknowledged. |
cancel_subscription | CancelSubscriptionRequest | End a consumer's registration, with the same meaning as the change-stream service's CancelSubscription. Answered with SubscriptionCancelled; an open subscription of that incarnation on this session then ends with a CONSUMER_TERMINATED error. |
Response: stream ServerFrame
| Field | Type | Description |
|---|---|---|
request_id | uint64 | request_id of the ClientFrame this event answers. |
begun | Begun | Acknowledges Begin and returns the allocated transaction handle. |
cursor_open | CursorOpen | Opens a cursor for a query, carrying the column header. |
rows | RowBatch | A batch of result rows for an open cursor; many may arrive per request. |
cursor_end | CursorEnd | Closes a cursor, carrying final query statistics. |
committed | Committed | Acknowledges Commit, carrying the causal applied-index token. |
error | SessionError | Reports an error for the request; terminates its cursor. |
connection_status | ConnectionStatus | The state of this connection: whether it can serve writes, what it can see of the cluster, and the settings in effect. Sent in answer to a Configure, and unsolicited whenever the state changes. |
subscribed | Subscribed | Acknowledges Subscribe, carrying the registration's incarnation. |
change_events | ChangeEventBatch | Events of a subscription, in log order, at most the credit left. |
acknowledged | Acknowledged | Acknowledges an acknowledge frame. |
subscription_cancelled | SubscriptionCancelled | Acknowledges a cancel_subscription frame. |
Types
AcknowledgeSubscriptionRequest
| Field | Type | Description |
|---|---|---|
consumer_id | string | The consumer acknowledging. |
incarnation | uint64 | Its incarnation, from the Subscribe response metadata. |
position | ResumeToken | The position of the last event the client no longer needs the source for: it holds the events durably, or it has durably taken their effect into the state it keeps (for example by reading the current state at a snapshot that covers this position). Everything up to it is acknowledged: the server may release that source for this consumer, a resume continues after it, and a BOUNDED consumer's progress lag is measured from it. |
Acknowledged
Acknowledges an acknowledge frame: the registration now holds the history from that position on only.
No fields.
Begin
Open an interactive transaction.
| Field | Type | Description |
|---|---|---|
ordering | Ordering | Statement ordering policy for the transaction. |
drain_timeout_ms | uint32 | How long (milliseconds) the server's reorder buffer waits for a missing nonce before aborting the transaction, in ORDERING_ORDERED mode. Zero uses the per-session default. Distinct from the idle-reap timeout that closes an untouched transaction. |
Begun
Acknowledges Begin.
| Field | Type | Description |
|---|---|---|
txid | uint64 | Allocated transaction handle, always non-zero. Pass it as Execute.txid and to Commit / Rollback. |
BoundedRetention
Finite bounds after which the registration ends. Both limits are required and must be above zero.
| Field | Type | Description |
|---|---|---|
max_progress_lag_ms | uint64 | Most age, in milliseconds, of the oldest log entry the consumer has not yet been sent. |
max_retained_bytes | uint64 | Most bytes of log the consumer's position may require the shard to keep. |
liveness_timeout_ms | uint64 | Longest time, in milliseconds, without the consumer being connected and heartbeating. Absent: the registration does not end for being absent, only for the two limits above. |
Cancel
Abort an in-flight request and close its cursor.
| Field | Type | Description |
|---|---|---|
target_request_id | uint64 | request_id of the in-flight request to abort. |
CancelSubscriptionRequest
| Field | Type | Description |
|---|---|---|
consumer_id | string | The consumer to cancel. |
incarnation | uint64 | The incarnation to cancel, from the Subscribe response metadata. A different incarnation of the same id is left alone. |
CdcFilters
Filters applied server-side before streaming events to the client.
| Field | Type | Description |
|---|---|---|
edge_types | string[] | If non-empty, only deliver events that touch at least one adjacency or edge-property key whose edge type matches one of these strings. Example: ["FOLLOWS", "LIKES"] Leave empty to receive all edge types. |
is_migration | bool | When set: only deliver events whose is_migration flag equals this value. When absent (HasField returns false): deliver both migration and non-migration events. |
ChangeEvent
A single applied Raft log entry delivered to the CDC consumer.
| Field | Type | Description |
|---|---|---|
ts | uint64 | HLC commit timestamp of the entry, in wall-clock microseconds since the Unix epoch with logical increments inside one microsecond: the latest commit timestamp of the transactions it carries. 0 for an entry that carries none (membership, leader blank). |
term | uint64 | Term of the leader that wrote this entry. |
log_index | uint64 | Raft log index. Monotonically increasing per shard. |
shard_id | uint32 | Shard that produced this entry. |
is_migration | bool | True if this entry was written during a shard migration (e.g. bulk data transfer). Most CDC consumers should skip migration entries. |
ops | ChangeOp[] | The mutations carried by this log entry. Empty for an entry that carries none, and for a progress event: entries up to position held nothing the stream's filters keep, so the client can acknowledge past them. |
position | ResumeToken | Where the stream continues after this event: pass it on reconnect to resume here, and to AcknowledgeSubscription once the event is held. |
ChangeEventBatch
Change events of one subscription, oldest first, as many as were ready and the credit allowed. Each event carries its own position, as on the change-stream service.
| Field | Type | Description |
|---|---|---|
events | ChangeEvent[] | The events, each as the change-stream service sends it; a progress event (no ops) lets the client acknowledge past entries its filters dropped. |
more | bool | True when entries the serving node had already applied were waiting past this batch when it was cut, because the credit ran out: granting more credit delivers them at once. False when the batch reached everything applied, so further events come as the node applies them. |
ChangeOp
A single storage mutation within a ChangeEvent.
| Field | Type | Description |
|---|---|---|
type | ChangeOpType | — |
partition | uint32 | Storage partition (see coordinode_storage::engine::partition::Partition). |
key | bytes | Storage key. Format depends on partition type. For REMOVE_RANGE this carries the range's inclusive start bound. |
value | bytes | Value bytes. Empty for DELETE ops; carries the merge operand for MERGE. For REMOVE_RANGE this carries the range's exclusive end bound (the half-open range deleted is [key, value)). |
ClientFrame
One operation sent by the client on the session stream.
| Field | Type | Description |
|---|---|---|
request_id | uint64 | Client-assigned, session-scoped correlation id. Every ServerFrame produced for this operation carries the same request_id, so a client demultiplexes concurrent responses and cursor chunks that arrive out of order. The client is responsible for keeping request_ids unique within a live session. |
execute | Execute | Run a query statement (autonomous or inside a transaction). |
begin | Begin | Open an interactive transaction; the server replies with a Begun(txid). |
commit | Commit | Commit an interactive transaction by its txid. |
rollback | Rollback | Roll back an interactive transaction by its txid. |
cancel | Cancel | Abort an in-flight request and close its cursor. |
configure | Configure | Read, and optionally change, this connection's settings. Answered with a ConnectionStatus carrying the settings now in effect. |
subscribe | Subscribe | Open a change-stream subscription on this session. Answered with Subscribed, then with ChangeEventBatch frames on this request_id as far as the credit granted reaches. |
credit | Credit | Grant a subscription of this session credit for more events. |
acknowledge | AcknowledgeSubscriptionRequest | Acknowledge a subscription's events, with the same meaning as the change-stream service's AcknowledgeSubscription. Answered with Acknowledged. |
cancel_subscription | CancelSubscriptionRequest | End a consumer's registration, with the same meaning as the change-stream service's CancelSubscription. Answered with SubscriptionCancelled; an open subscription of that incarnation on this session then ends with a CONSUMER_TERMINATED error. |
Commit
Commit an interactive transaction.
| Field | Type | Description |
|---|---|---|
txid | uint64 | Transaction handle from a prior Begun. |
last_nonce | uint64 | Expected final nonce of the transaction's statement chain, in ORDERING_ORDERED mode, so the server can detect a complete chain before it commits. Zero when unset (UNORDERED transactions, or callers that do not pipeline ahead of the commit). |
operation | OperationRef | The client operation the transaction carries out, allocated before the Commit is sent. Its writes take effect at most once: after a lost reply the client resolves the same operation (OperationService.ResolveOperation) on any connection, and a repeated commit of it runs nothing again. Absent commits unbound. |
Committed
Acknowledges Commit.
| Field | Type | Description |
|---|---|---|
applied_index | uint64 | Raft log index the commit was applied at on the serving node: the causal operationTime token a client passes as after_index on later causal reads. Zero in embedded mode (no Raft cluster). |
commit_ts | uint64 | HLC commit timestamp (microseconds since the Unix epoch) every mutation of the transaction was applied at. Server-assigned. Equal to the storage sequence number of the write, so it is the exact snapshot anchor: AS OF TIMESTAMP <commit_ts> sees this transaction and nothing committed later; a change-stream consumer that has processed it resumes from commit_ts + 1. Present in every mode; a read-only transaction reports its pinned read timestamp. |
Configure
Read, and optionally change, the settings this connection applies to statements that do not carry their own.
Every field is optional: one that is absent is left as it is, so a client changes one setting without restating the others, and a Configure with none set is simply a request to report the current status. The server answers with a ConnectionStatus whose settings are the ones now in effect, which is how a client confirms a change actually took rather than assuming it did.
| Field | Type | Description |
|---|---|---|
read_concern | ReadConcern | Default read concern for statements that carry none. |
write_concern | WriteConcern | Default write concern for statements that carry none. |
read_preference | ReadPreference | Default read preference for statements that carry none. |
drain_timeout_ms | uint32 | Default reorder-buffer drain timeout, in milliseconds, for transactions opened with ORDERING_ORDERED and no explicit drain_timeout_ms. |
vector_consistency | VectorConsistency | Vector consistency for statements whose query names none in a hint; the same setting a SET vector_consistency = '...' statement on this session changes. UNSPECIFIED, like absent, leaves the setting as it is. |
vector_build_wait_ms | uint32 | How long statements wait for a vector index still being built, in milliseconds, when their query names no bound in a hint; the same setting a SET vector_build_wait = '...' statement on this session changes. |
query_memory_limit_mb | uint32 | Memory limit of each statement, in MiB, when the statement names none; the same setting a SET query_memory_limit_mb = N statement on this session changes. Zero or a value past the administrative ceiling (4096 MiB) is rejected and changes nothing. |
ConnectionStatus
The state of this connection, from the serving node's point of view.
Sent unsolicited whenever it changes, with request_id zero, because the change a client is usually waiting for is one nobody asked about: a node cut off from the cluster cannot serve writes, and the client needs to know the moment it can again. Holding the session and waiting for that event beats retrying on a timer whose interval is a guess about how long an election takes. It is also the answer to a Configure, where request_id echoes it.
This describes THIS connection, not the cluster: it is what this node can do for this client right now. The cluster-wide picture, with every node's role and lag, is an operator's view and lives in the admin service.
| Field | Type | Description |
|---|---|---|
writable | bool | Whether statements that write can be served through this connection right now. True on the leader, and true on a follower that can reach the leader, since a write arriving at a follower is carried there. False when no leader is reachable, which is the condition a waiting client is watching for the end of. |
connected | bool | Whether this node has contact with the cluster at all. False on a node that has lost touch with its peers: reads from it still answer, from a snapshot that no longer advances. |
leader_id | uint64 | The node the cluster last named leader. Unset while an election is in flight or this node cannot tell. |
served_by_leader | bool | Whether the node serving this connection is itself the leader. A client that wants to avoid the forwarding hop can use this to decide whether to reconnect to the leader named above. |
raft_term | uint64 | Raft term this status was observed in. Increases at every election, so a client can tell a genuine leadership change from a repeated report. |
voters | uint32 | Voting members the cluster is configured with. |
voters_reachable | uint32 | Voting members this node currently counts as reachable, including itself. Compared against voters, this is what "the majority is present" means here, and it is what turns a vague outage into a number an operator and a client can both act on. |
settings | Configure | The settings in effect for statements that carry none of their own. Echoed whole so a client can confirm a Configure took effect, rather than assume the fields it sent are the ones now applied. |
ConsumerRetention
How long a consumer's registration protects the history it still needs. One of the two must be chosen; there is no default.
| Field | Type | Description |
|---|---|---|
strict | StrictRetention | Protection lasts until the consumer is cancelled. Missing heartbeats do not end it. |
bounded | BoundedRetention | Protection ends once one of the declared bounds is crossed. |
Credit
More credit for a subscription of this session: the server sends that many more events on it. Unused credit accumulates; each event sent, a progress event included, uses one. A subscription without credit sends nothing and holds no part of the session's flow-control window, so it never delays the other requests of the session.
| Field | Type | Description |
|---|---|---|
target_request_id | uint64 | request_id of the Subscribe frame that opened the subscription. |
events | uint32 | Events added to the subscription's credit. Above zero. |
CursorEnd
Closes a result cursor.
| Field | Type | Description |
|---|---|---|
stats | QueryStats | Final query statistics for the request. Reuses the unary query stats so the causal applied-index and write counts decode identically. |
CursorOpen
Opens a result cursor.
| Field | Type | Description |
|---|---|---|
columns | string[] | Result column names, in result order. |
Execute
Execute one query statement.
| Field | Type | Description |
|---|---|---|
query | string | Query text in the session's dialect (Cypher today; SQL once the SQL frontend lands). The server selects a query frontend per session or per statement and never inspects the syntax above that frontend. |
parameters | map<string, PropertyValue> | Named query parameters bound at execution time. Same shape as the unary ExecuteCypherRequest parameters. |
txid | uint64 | Interactive transaction handle from a prior Begun. Zero means the statement is autonomous (implicit begin + commit). Non-zero runs the statement inside that transaction: it reads the transaction's pinned snapshot and its writes buffer until Commit. |
nonce | uint64 | Per-transaction ordering nonce, used only when the transaction was opened with ORDERING_ORDERED. The server applies the transaction's statements in ascending nonce order regardless of wire-arrival order. Ignored for autonomous statements and for ORDERING_UNORDERED transactions. |
read_concern | ReadConcern | Read concern of this statement alone. Absent, the statement takes the session's (set by Configure), and a session that set none the server's configured default. Within the message, a level of READ_CONCERN_LEVEL_UNSPECIFIED and a zero after_index or at_timestamp likewise leave that part to the session. Ignored inside a transaction, whose reads are pinned when it begins. |
write_concern | WriteConcern | Write concern of this statement alone, resolved like read_concern. A combination the server cannot honour is refused with INVALID_ARGUMENT. |
read_preference | ReadPreference | Read preference of this statement alone, resolved like read_concern. |
source | SourceLocation | Where in the client's code the statement was issued, for the query advisor: statements are counted per location, and one location issuing the same statement many times in a row is reported as an N+1 pattern. The application name and version come from the session's x-source-app and x-source-version metadata. Absent, the statement is counted without a location. |
operation | OperationRef | The client operation an autonomous statement (txid zero) carries out. Its writes take effect at most once however it is retried, on this stream or another: a retry of a statement that already took effect runs nothing and is answered with a SessionError naming its outcome (reason OPERATION_SETTLED). Absent runs the statement unbound. Refused inside a transaction, whose operation is named on its Commit. |
MultiVector
An ordered set of equal-width vectors representing one item, as produced by late-interaction retrieval models (ColBERT v2, MaxSim) where a document is several token-level embeddings rather than one pooled vector.
Every row carries the same number of dimensions; the sender enforces that invariant, so a receiver may read rows[0] for the width.
| Field | Type | Description |
|---|---|---|
rows | Vector[] | — |
OperationRef
A reference to one client operation: what a client persists before sending a write and sends again with every retry of it, on any connection and to any member.
| Field | Type | Description |
|---|---|---|
issuer | bytes | The logical client: 16 bytes the client chooses once and keeps across its restarts (a random value, or a digest of a stable application identity). Independent clients use different issuers; a connection, session or server is not an issuer. |
incarnation | uint64 | The issuer's incarnation the number belongs to, from EnrollIssuerResponse. |
sequence | uint64 | The operation's number within the incarnation, allocated by the client: starting at EnrollIssuerResponse.next_sequence, each new write takes the next number, and a retry of a write keeps its number. Numbers are an identity, not an execution order: writes with different numbers may run concurrently and complete in any order. |
deployment | bytes | The deployment that enrolled the incarnation, 16 bytes, from EnrollIssuerResponse.deployment. A server of another deployment refuses the reference with INVALID_ARGUMENT, reason FOREIGN_OPERATION, rather than admit it as a new operation. |
Path
A graph path: the alternating node/relationship sequence produced by shortestPath(...) and by a variable-length MATCH p = (a)-[*]->(b).
rels has exactly one fewer entry than nodes on a non-empty path, and the n-th hop connects nodes[n] to nodes[n+1]. An empty path (a single node, zero hops) carries one node and no relationships.
| Field | Type | Description |
|---|---|---|
nodes | uint64[] | Node ids along the path, start to end. |
rels | PathRel[] | Relationship hops, in the same order. |
PathRel
One relationship hop inside a Path: its type and endpoint node ids. Relationship properties are not carried; fetch them by endpoint pair when they are needed.
| Field | Type | Description |
|---|---|---|
edge_type | string | — |
source | uint64 | — |
target | uint64 | — |
QueryStats
| Field | Type | Description |
|---|---|---|
nodes_created | int64 | — |
nodes_deleted | int64 | — |
edges_created | int64 | — |
edges_deleted | int64 | — |
properties_set | int64 | — |
execution_time_ms | int64 | — |
applied_index | uint64 | Raft log index applied on the serving node at query time. Clients use this as after_index in subsequent causal reads. 0 means the node is not part of a Raft cluster (embedded mode). |
served_by_leader | bool | True when the read was served by the Raft leader. False for follower reads (read_preference = SECONDARY or NEAREST). |
commit_ts | uint64 | The HLC timestamp this statement's writes landed at, for a statement that committed on its own. Zero for a read, and for a statement inside an interactive transaction, whose timestamp belongs to the commit that ends it (CommitTransactionResponse.commit_ts). This is the version of what the statement wrote: the same number Node.version reports and CommitTransactionRequest.expect is stated against. A client that writes and then means to write again conditionally already holds what to state, with no read in between. |
read_as_of_ts | uint64 | Set by a member that does not run the version its group runs and so is read-only: the commit timestamp of the last entry it applied, which this read reflects and nothing after. Zero for a read served by a member that runs its group's version. A read that must be current is refused by such a member instead (FAILED_PRECONDITION, reason MEMBER_READ_ONLY). |
ReadConcern
Read concern configuration.
| Field | Type | Description |
|---|---|---|
level | ReadConcernLevel | Consistency level for this read. UNSPECIFIED defaults to LOCAL. |
after_index | uint64 | Causal fence: wait until the serving node has applied log entries up to at least this Raft log index before executing the read. Set to the QueryStats.applied_index value from a prior write response to guarantee read-your-writes: the read is guaranteed to observe all mutations up to and including that write. 0 = no fence (default). Only valid with level = MAJORITY or SNAPSHOT; returns FAILED_PRECONDITION if level = LOCAL or LINEARIZABLE. Has no effect in standalone (non-Raft) mode — all writes are immediately visible. The returned applied_index will always be 0 in standalone mode, so clients should not set after_index unless operating in cluster mode. |
at_timestamp | uint64 | Snapshot pin: read the database as of this HLC timestamp (microseconds since Unix epoch, leader-assigned). Only valid with level = SNAPSHOT. Setting this with any other level returns FAILED_PRECONDITION. 0 = no pin (latest snapshot of the chosen level applies). Typical use: time-travel reads ("what did this query return at 2026-05-15 12:00:00?"). The timestamp must be within the MVCC retention window — older snapshots are GC'd. Reads beyond retention return UNAVAILABLE. Distinct from after_index: after_index is a fence (wait until at least this index is applied), at_timestamp is a pin (read exactly this version, no waiting). |
ResumeToken
Position in a shard's Raft log used to resume after disconnect.
The token names one log index, segment_id + entry_offset: the next entry to deliver. It stays valid when the server rewrites its log files.
| Field | Type | Description |
|---|---|---|
shard_id | uint32 | Shard this stream targets. Always 0 in CE single-shard mode. |
segment_id | uint64 | Log index of the first entry of the segment that held the last delivered entry. 0 together with entry_offset 0 means "the oldest retained entry". |
entry_offset | uint64 | Entries of that segment already delivered, counted from segment_id. |
Rollback
Roll back an interactive transaction, discarding all buffered writes.
| Field | Type | Description |
|---|---|---|
txid | uint64 | Transaction handle from a prior Begun. |
Row
| Field | Type | Description |
|---|---|---|
values | PropertyValue[] | — |
RowBatch
A batch of result rows for an open cursor. Rows reuse the unary query Row message so a session result and a unary result decode identically.
| Field | Type | Description |
|---|---|---|
rows | Row[] | Result rows, each a list of property values aligned to CursorOpen.columns. |
ServerFrame
One result event sent by the server on the session stream.
| Field | Type | Description |
|---|---|---|
request_id | uint64 | request_id of the ClientFrame this event answers. |
begun | Begun | Acknowledges Begin and returns the allocated transaction handle. |
cursor_open | CursorOpen | Opens a cursor for a query, carrying the column header. |
rows | RowBatch | A batch of result rows for an open cursor; many may arrive per request. |
cursor_end | CursorEnd | Closes a cursor, carrying final query statistics. |
committed | Committed | Acknowledges Commit, carrying the causal applied-index token. |
error | SessionError | Reports an error for the request; terminates its cursor. |
connection_status | ConnectionStatus | The state of this connection: whether it can serve writes, what it can see of the cluster, and the settings in effect. Sent in answer to a Configure, and unsolicited whenever the state changes. |
subscribed | Subscribed | Acknowledges Subscribe, carrying the registration's incarnation. |
change_events | ChangeEventBatch | Events of a subscription, in log order, at most the credit left. |
acknowledged | Acknowledged | Acknowledges an acknowledge frame. |
subscription_cancelled | SubscriptionCancelled | Acknowledges a cancel_subscription frame. |
SessionError
Reports an error for a request.
| Field | Type | Description |
|---|---|---|
code | uint32 | Stable numeric error code (mirrors the gRPC status taxonomy used elsewhere on the server). Lets a client branch on the failure class without parsing the message text. |
message | string | Human-readable error detail for logs and diagnostics. Not a stable contract; branch on code, not on this string. |
status | Status | The canonical status for the error, with the same typed details (an ErrorInfo with its reason and metadata, a RetryInfo) the matching unary or server-streaming RPC returns in its grpc-status-details-bin trailer. Set for subscription errors (RETENTION_LOST, CONSUMER_TERMINATED, the registry's refusals); a client branches on its ErrorInfo reason. |
SourceLocation
A place in the client's source code, sent by a driver in debug mode.
| Field | Type | Description |
|---|---|---|
file | string | Source file path as the client knows it. |
line | uint32 | Line number in that file, starting at 1. |
function | string | Enclosing function or method name; empty when the client cannot tell. |
StrictRetention
Protection until cancellation.
No fields.
Subscribe
Open a change-stream subscription on the session.
The registration it reads as lives in the shard's consumer registry, not in the session: closing the session ends only delivery, and the consumer resumes its incarnation from another session or through the change-stream service.
| Field | Type | Description |
|---|---|---|
request | SubscribeRequest | Which consumer to register or resume and where to start, exactly as the change-stream service's Subscribe takes it. |
credit | uint32 | Events the client can take before its first Credit frame. Zero sends nothing until a Credit arrives. |
SubscribeRequest
| Field | Type | Description |
|---|---|---|
resume_token | ResumeToken | Token from the last received ChangeEvent.position. Omit (all-zero) to start from the oldest retained entry. |
filters | CdcFilters | Optional filter to reduce bandwidth. |
consumer_id | string | The consumer this stream reads as: globally unique, chosen by the client. Required. |
incarnation | uint64 | 0 registers the consumer anew with retention, starting at resume_token (or the oldest retained entry without one); refused with ALREADY_EXISTS while another incarnation of the id is live. Any other value resumes that live incarnation, and retention is ignored. |
retention | ConsumerRetention | Required when registering (incarnation 0). |
Subscribed
Acknowledges Subscribe.
| Field | Type | Description |
|---|---|---|
incarnation | uint64 | Incarnation of the registration the subscription reads as: the one just registered, or the one resumed. Pass it to acknowledge and cancel_subscription. |
SubscriptionCancelled
Acknowledges a cancel_subscription frame: the registration has ended.
No fields.
Timestamp
An instant on the time axis of a TIMESTAMP property.
| Field | Type | Description |
|---|---|---|
unix_micros | int64 | Microseconds since the Unix epoch (1970-01-01T00:00:00Z), signed: an instant before the epoch is negative. Microseconds are the database's own resolution, so the value round-trips exactly; a client converts it to its native type (a nanosecond type reaches it losslessly). |
WriteConcern
Write concern configuration for a write statement or a session default.
Two independent axes, as in MongoDB: w (how many members acknowledge) and journal (what state each of them holds the write in). w is either a count of members or a named mode; the two never share a number space, so acks: 3 is three members in a group of any size and can never be confused with a mode. Leaving w unset selects the default, MAJORITY; asking for fire-and-forget is always explicit (acks: 0). Neither axis is ever silently changed to satisfy the other: a combination the server cannot honour is rejected with INVALID_ARGUMENT.
| Field | Type | Description |
|---|---|---|
journal | Journal | The state each counted member holds the write in. Omitted = JOURNAL. CACHE and MEMORY are accepted only with acks: 0 or acks: 1: a volatile state cannot be confirmed across members, so combining them with acks above 1 or with MAJORITY is rejected with INVALID_ARGUMENT. |
timeout_ms | uint32 | Time in milliseconds to wait for w to be satisfied; 0 = no timeout. On timeout the call fails, but the write is NOT rolled back: it may still commit afterwards. |
acks | uint32 | Number of members, the leader included, that must hold the write in the journal state before the caller is answered. 0 = fire-and-forget: the write still goes through the leader and the log, the caller is answered at once and is not told whether it committed. 1 = the leader alone (rollback possible if the leader fails before replication). N = N members. A value above the group's member count is rejected with INVALID_ARGUMENT. |
mode | WriteConcernMode | A named rule instead of a count. See WriteConcernMode. |
Enums
ChangeOpType
| Value | Number | Description |
|---|---|---|
CHANGE_OP_TYPE_UNSPECIFIED | 0 | — |
INSERT | 1 | — |
DELETE | 2 | — |
MERGE | 3 | — |
NOOP | 4 | — |
RAFT_ENTRY | 5 | — |
RAFT_TRUNCATION | 6 | — |
REMOVE_RANGE | 7 | Delete every key in the half-open range [key, value) of partition with a single range tombstone. Emitted for a dense contiguous run of deleted keys (run-length coalescing) or a whole-prefix DROP; the range covers only keys that are all being deleted, never a surviving key in a gap. |
Journal
The state each acknowledging member must hold the write in before it counts towards w. Independent of w: w says how many members, journal says how durably each of them holds the write.
A write concern decides when the caller is answered, never whether the write is replicated: every write enters the group's log through the leader and is applied on every member. CACHE and MEMORY answer before the write is in the log and keep it in a volatile overlay until the drain proposes it; a leader crash before the drain loses every write still in that overlay. Use them for telemetry, hot counters and session state only, never for source-of-truth data.
| Value | Number | Description |
|---|---|---|
JOURNAL_UNSPECIFIED | 0 | Same as JOURNAL: the default when the field is omitted. |
JOURNAL_JOURNAL | 1 | The write is fsynced to the member's journal (the Raft log) before it is counted. Survives process crash and power failure. |
JOURNAL_CACHE | 2 | The write is in the member's RAM + NVMe overlay (~100µs) before it is counted. Survives a process crash, not a power failure before the drain. |
JOURNAL_MEMORY | 3 | The write is in the member's RAM-only overlay (~1µs) before it is counted. Visible at once to local readers that accept volatile data; lost on process crash before the drain. |
Ordering
Statement ordering policy for an interactive transaction, fixed at Begin.
| Value | Number | Description |
|---|---|---|
ORDERING_UNSPECIFIED | 0 | Treated as ORDERING_ORDERED. |
ORDERING_ORDERED | 1 | Each statement carries a per-transaction monotonic nonce. The client numbers the chain and may send frames out of wire order; the server reassembles by nonce in a reorder buffer and applies strictly in nonce order. A failure at nonce K aborts the transaction. |
ORDERING_UNORDERED | 2 | The client bursts statements without awaiting; the server applies them serially in wire-arrival order. The first failing statement rolls the whole transaction back. |
ReadConcernLevel
Read concern levels.
| Value | Number | Description |
|---|---|---|
READ_CONCERN_LEVEL_UNSPECIFIED | 0 | — |
READ_CONCERN_LEVEL_LOCAL | 1 | Read from local replica (may be stale). |
READ_CONCERN_LEVEL_MAJORITY | 2 | Read data committed by majority. |
READ_CONCERN_LEVEL_LINEARIZABLE | 3 | Linearizable read (strongest guarantee). |
READ_CONCERN_LEVEL_SNAPSHOT | 4 | Read from a consistent MVCC snapshot. |
ReadPreference
Read preference for routing read operations.
| Value | Number | Description |
|---|---|---|
READ_PREFERENCE_UNSPECIFIED | 0 | — |
READ_PREFERENCE_PRIMARY | 1 | — |
READ_PREFERENCE_PRIMARY_PREFERRED | 2 | — |
READ_PREFERENCE_SECONDARY | 3 | — |
READ_PREFERENCE_SECONDARY_PREFERRED | 4 | — |
READ_PREFERENCE_NEAREST | 5 | — |
VectorConsistency
How a vector search treats the read's snapshot: the same modes as the query hint vector_consistency('...') and the session command SET vector_consistency = '...'. A hint in the query wins over this setting.
| Value | Number | Description |
|---|---|---|
VECTOR_CONSISTENCY_UNSPECIFIED | 0 | Unset: left to the next level down, the session's setting and then the mode the query's read consistency implies. |
VECTOR_CONSISTENCY_CURRENT | 1 | The index's current state with no visibility filter: fastest, best recall, may include writes newer than the snapshot. |
VECTOR_CONSISTENCY_SNAPSHOT | 2 | Index candidates filtered by visibility at the snapshot. |
VECTOR_CONSISTENCY_EXACT | 3 | Every vector of the label at the snapshot, without the index: exact, and its cost grows with the label. |
WriteConcernMode
Named write concern modes: rules for w that are not a fixed count of members.
| Value | Number | Description |
|---|---|---|
WRITE_CONCERN_MODE_UNSPECIFIED | 0 | Not a valid choice on the wire: a WriteConcern whose w is unset means the default, MAJORITY. Set mode explicitly to one of the values below. |
WRITE_CONCERN_MODE_MAJORITY | 1 | Acknowledged once a majority of the group's members (the leader included) holds the write in the state named by journal. Survives the loss of a minority. The default. |
