Replication, Repair, Backup and Node Replacement

Article · 8:00

Replication and topology as in Cassandra, repair and the Manager, snapshots and backup tooling, node replacement, and multi-datacentre design.

Replication, racks, datacentres, hints and the repair contract are all as in Cassandra, and the Cassandra course covers them. The important facts carry over unchanged: NetworkTopologyStrategy per datacentre; replicas in distinct racks; hints kept only for a window, after which a returned node has permanently missed writes until a repair; and repair must complete more often than gc_grace_seconds or deleted data comes back.

What differs here is the tooling, and the difference is substantial enough to change how you operate.

ScyllaDB Manager is a separate service that manages repair and backup for the cluster. For repair it runs a row-level repair, scheduled, with progress tracking and the ability to pause and resume - and because it is cluster-aware it handles the "repair every node, cover every range once" problem for you rather than leaving you to orchestrate -pr runs. In Cassandra the equivalent is Reaper, a third-party tool. Row-level repair is also materially more efficient than Cassandra's Merkle-tree comparison for many workloads, because it streams only differing rows.

For backup, Manager handles snapshot, upload to object storage, retention and restore, with the cluster topology recorded - which removes the "snapshot then rsync it somewhere, somehow" step that Cassandra leaves to you.

The manual path still exists and is worth knowing: nodetool repair, nodetool snapshot, and the files on disk. Use Manager in production; know the manual commands because you will need them during an incident when Manager is the thing that is broken.

Node replacement follows the same shape as Cassandra - replace a dead node by taking over its token ranges, decommission a live one so it streams its data away first - with ScyllaDB-specific options and, in recent versions, tablets, which change how data is distributed and make adding capacity faster and more incremental. If your version supports tablets, read its documentation: the replacement and scaling procedures differ from the vnode ones.

One operationally important difference: because the cache is ScyllaDB's own and starts cold, a replaced or restarted node is up and slow for a measurable period. A rolling restart that moves to the next node as soon as the previous one reports UN can therefore degrade the whole cluster's latency, one node at a time. Wait for the cache hit ratio to recover, not for the node to be up.

Laboratory exercise 5 - lose a node, then lose everything.

Set up a three-node cluster with three racks and RF=3, and deploy ScyllaDB Manager against it. Confirm replicas land in distinct racks.

Kill a node under write load at LOCAL_QUORUM and measure: writes continuing, the per-shard latency change on the surviving nodes, and hints accumulating. Bring it back and measure the cache warm-up curve as well as the hint replay - and record how long it was "up but slow".

Kill a node for longer than the hint window, bring it back, show it missing data, and repair it with Manager. Record the repair duration and the data streamed, and compare with a manual nodetool repair.

Schedule a repair in Manager and verify it runs, completes and reports; then alert on repair recency.

Configure backup to object storage in Manager, take a backup, destroy the node entirely, and restore. Record RPO and RTO, measured, and verify with assertions read at CONSISTENCY ALL.

Replace the node properly, then demonstrate the rolling-restart trap: restart all three nodes waiting only for UN, and measure the cluster p99 throughout; then do it again waiting for the cache hit ratio and compare.

Deliverable: the rack configuration with endpoint proof, the node loss measurements including the cache warm-up curve, the beyond-hint-window demonstration and its repair, the Manager against manual repair comparison, the scheduled repair evidence, the backup and restore with measured RPO and RTO, and the two rolling-restart p99 curves.

-- ==================================================================
-- Replication, racks, DCs, hints and the repair contract: AS
-- CASSANDRA. The Cassandra course covers them; they carry over
-- unchanged.
-- ==================================================================
ALTER KEYSPACE game WITH replication = {
  'class': 'NetworkTopologyStrategy', 'dc1': 3, 'dc2': 3 };
--   nodetool status game
--   nodetool getendpoints game events_by_player_hour 7f3c...
--     -> must be DISTINCT RACKS
--
--   The facts that carry over, and still matter most:
--     * hints are kept for a WINDOW; past it, a returned node has
--       PERMANENTLY MISSED writes until a repair
--     * *** REPAIR MUST COMPLETE MORE OFTEN THAN gc_grace_seconds,
--       OR DELETED DATA COMES BACK ***
--     * CONSISTENCY ALL on a verification read makes every replica
--       answer, so divergence shows up

-- ==================================================================
-- *** SCYLLADB MANAGER: the substantial tooling difference. ***
-- ==================================================================
--   sctool cluster add --host 172.17.0.2 --name production \
--     --auth-token <token>
--   sctool cluster list
--   sctool status -c production
--
-- REPAIR, scheduled and cluster-aware:
--   sctool repair -c production --intensity 1 --parallel 2
--   sctool task list -c production
--   sctool task progress -c production repair/<id>
--   sctool task update -c production repair/<id> --cron "0 */12 * * *"
--
--   WHY THIS IS BETTER THAN ORCHESTRATING nodetool:
--     * ROW-LEVEL REPAIR, which streams only DIFFERING ROWS rather
--       than comparing Merkle trees - materially more efficient for
--       many workloads
--     * CLUSTER-AWARE, so it handles "repair every node, cover every
--       range exactly once" for you, instead of leaving you to
--       orchestrate -pr runs across nodes
--     * progress tracking, PAUSE and RESUME, and intensity control
--       so a repair does not consume the cluster
--     * In Cassandra the equivalent is Reaper, a third-party tool.
--
-- BACKUP, with retention and restore:
--   sctool backup -c production --location s3:my-backup-bucket \
--     --retention 7 --rate-limit 100
--   sctool backup list -c production
--   sctool backup files -c production --snapshot-tag sm_20261130...
--   sctool restore -c production --location s3:my-backup-bucket \
--     --snapshot-tag sm_20261130140400UTC --restore-tables
--
--   This removes the "snapshot, then rsync it somewhere, somehow"
--   step Cassandra leaves entirely to you - including recording the
--   TOPOLOGY, so a restore into a different cluster shape works.

-- THE MANUAL PATH STILL EXISTS, AND KNOW IT:
--   nodetool repair -pr game
--   nodetool snapshot -t before-upgrade game
--   nodetool listsnapshots
--   nodetool clearsnapshot -t before-upgrade game
--   nodetool refresh game events_by_player_hour
--
--   *** Use Manager in production; know the manual commands because
--   *** you will need them during an incident when MANAGER is the
--   *** thing that is broken. ***

-- ==================================================================
-- NODE REPLACEMENT: the same shape, with ScyllaDB specifics.
-- ==================================================================
-- A DEAD node -> take over its token ranges:
--   /etc/scylla/scylla.yaml on the replacement:
--     replace_node_first_boot: <host-id of the dead node>
--   then start it; it streams from the other replicas.
--     nodetool netstats
--     nodetool status          # UJ -> UN
--   then: sctool repair, or nodetool repair, on the new node.
--
-- A PLANNED removal -> stream its data away first:
--   nodetool decommission
--
-- ALREADY GONE and not being replaced:
--   nodetool removenode <host-id>
--
-- TABLETS (recent versions): data is distributed in TABLETS rather
-- than fixed vnode ranges, which makes adding capacity FASTER and
-- MORE INCREMENTAL - a new node starts serving before it holds
-- everything. *** If your version has tablets enabled, READ ITS
-- DOCUMENTATION: the replacement and scaling procedures DIFFER from
-- the vnode ones. ***
--   nodetool describecluster
--   SELECT * FROM system.tablets;      -- where supported

-- ==================================================================
-- *** THE ROLLING-RESTART TRAP, specific to this engine. ***
-- ==================================================================
-- Because the cache is ScyllaDB's OWN and starts COLD, a replaced or
-- restarted node is *** UP AND SLOW *** for a measurable period.
--
-- A rolling restart that moves to the next node as soon as the
-- previous reports UN therefore degrades the WHOLE CLUSTER'S
-- LATENCY, one node at a time, for the duration.
--
--   WRONG:   restart node1 -> wait for UN (30 s) -> restart node2 ...
--            -> every node cold in turn, p99 bad for the whole hour
--
--   RIGHT:   restart node1 -> wait for UN -> *** WAIT FOR THE CACHE
--            HIT RATIO TO RECOVER *** -> restart node2 ...
--
--   The metric to wait on:
--   curl -s http://localhost:9180/metrics | grep -E \
--     'scylla_cache_reads|scylla_cache_reads_with_misses'
--   -> hit ratio back within a few points of its steady state
--
-- Measure both procedures' cluster p99 curves in the lab. The
-- difference is the lesson, and it belongs in the runbook as a wait
-- condition rather than a sleep.

-- ==================================================================
-- VERIFY WITH ASSERTIONS, not with nodetool status.
-- ==================================================================
CONSISTENCY ALL;
SELECT COUNT(*) FROM events_by_player_hour
WHERE player_id = 7f3c... AND day = '2026-11-30' AND hour = 14;
--   Every replica must answer, so a missing or divergent one errors
--   rather than hiding behind a quorum.
--   ... then run the capstone invariants.

Discussion

No questions on this topic yet. Sign in to ask the first one.