Why architecture matters here
Hinted handoff architecture matters because Cassandra's availability story depends on it. Without hints, a brief replica outage would require full repair — a heavy process. With hints, seconds-to-minutes outages heal automatically.
Cost is proportional to hint volume. During prolonged outage, hint queue grows; may need config tuning.
Reliability of the recovery depends on hint TTL vs actual outage duration. Longer than TTL and you need repair.
The architecture: every piece explained
Walk the diagram top to bottom.
Client Write. Arrives at coordinator with a consistency level.
Coordinator. Sends write to all replicas per replication factor. Sees one replica down.
Store Hint. Coordinator stores a hint (durable, replica-target + payload) for the offline replica.
Hint TTL. Default 3 hours; configurable. Hints beyond TTL discarded.
Retry policy. Coordinator periodically probes offline replica; delivers hints on comeback.
Replay on comeback. Streams stored hints to the replica in batches.
Storage: hints/ directory. Per-node local storage. Each hint identifies target replica + write payload.
Repair for gaps. Outages exceeding TTL leave data gaps requiring full repair.
Hint queue overflow. If too many hints buffer, node may pause writes or drop hints.
Not a substitute for repair. Repair remains the anti-entropy mechanism for long-term consistency.
End-to-end hint lifecycle
Trace a scenario. Write with RF=3, CL=QUORUM. Coordinator sends to replicas A, B, C. B is down.
A and C ack; QUORUM met; client succeeds. Coordinator stores a hint for B locally.
Every 10 seconds, coordinator sends a probe to B. B still down.
B comes back after 20 minutes. Next probe succeeds. Coordinator streams accumulated hints to B in batches. B catches up.
Repair is not needed because hints covered the outage. Cluster is fully consistent again.
Alternative: B is down for 8 hours. TTL is 3 hours. First 3 hours worth of hints delivered when B returns; last 5 hours' hints were dropped. Repair is needed to fix the gap.
Alternative: massive write storm during outage; hint queue overflows. Coordinator may pause new hints (backpressure) or start dropping. Alert fires.