Skip to content

VOLUME.STATS REPLICATION

Returns replication state for a specific standby member on a named volume.

VOLUME.STATS <volume-name> REPLICATION <standby-id>
ArgumentTypeDescription
volume-namestringName of the volume, in <kind>-shard-<id> format (e.g. bucket-shard-0)
standby-idstringMember ID of the standby to inspect

RESP3 map with the following fields:

FieldTypeDescription
stagestringCurrent replication stage (e.g. SEGMENT_REPLICATION, CHANGE_DATA_CAPTURE), or empty string if not started
statusstringReplication status (e.g. WAITING, RUNNING, FAILED), or empty string if unknown
error_messagestringError description if replication has failed, or empty string
cursor_segment_idintegerSegment ID the replication cursor is currently on (0 if not started)
cursor_positionintegerByte position within the cursor segment (0 if not started)
cdc_sequence_numberintegerChange data capture sequence number (0 if not in CDC stage)
cdc_positionintegerPosition within the current CDC sequence (0 if not in CDC stage)

Reads the replication status of the given standby for the named volume.

Fields default to empty strings (for stage, status, error_message) or zero (for numeric fields) when replication has not started or the standby subspace has not been initialized.

This command requires exactly 3 arguments total (volume name, subcommand, standby ID).

This command is available on the management port (default 3320).

Argument errors:

Error CodeError messageCause
ERRinvalid number of arguments-
ERRinvalid volume name: <name>The name does not match the <kind>-shard-<id> format.
ERRInvalid memberId: <id>The value is neither a 40-character member ID nor a 4-character prefix.

Replication in segment replication stage:

127.0.0.1:3320> VOLUME.STATS bucket-shard-0 REPLICATION standby-member-1
1# "stage" => "SEGMENT_REPLICATION"
2# "status" => "RUNNING"
3# "error_message" => ""
4# "cursor_segment_id" => (integer) 2
5# "cursor_position" => (integer) 51200
6# "cdc_sequence_number" => (integer) 0
7# "cdc_position" => (integer) 0

Replication in change data capture stage:

127.0.0.1:3320> VOLUME.STATS bucket-shard-0 REPLICATION standby-member-1
1# "stage" => "CHANGE_DATA_CAPTURE"
2# "status" => "RUNNING"
3# "error_message" => ""
4# "cursor_segment_id" => (integer) 3
5# "cursor_position" => (integer) 0
6# "cdc_sequence_number" => (integer) 42
7# "cdc_position" => (integer) 1024

Replication not yet started:

127.0.0.1:3320> VOLUME.STATS bucket-shard-0 REPLICATION standby-member-1
1# "stage" => ""
2# "status" => "WAITING"
3# "error_message" => ""
4# "cursor_segment_id" => (integer) 0
5# "cursor_position" => (integer) 0
6# "cdc_sequence_number" => (integer) 0
7# "cdc_position" => (integer) 0

Failed replication:

127.0.0.1:3320> VOLUME.STATS bucket-shard-0 REPLICATION standby-member-1
1# "stage" => "SEGMENT_REPLICATION"
2# "status" => "FAILED"
3# "error_message" => "Connection refused"
4# "cursor_segment_id" => (integer) 1
5# "cursor_position" => (integer) 4096
6# "cdc_sequence_number" => (integer) 0
7# "cdc_position" => (integer) 0