Skip to content
LinkState
Go back

Safely disabling topology hints during a live incident

##Introduction to Staged Remediation

Understanding Topology Hints

Topology hints are metadata that a node attaches to outgoing requests to steer traffic toward replicas that are topologically close (e.g., same rack, same availability zone). In distributed data stores such as Cassandra, ScyllaDB, and CockroachDB, hints reduce cross‑zone latency and improve read‑locality. When hints become stale or mis‑aligned—often after a network partition, node replacement, or zone‑level outage—they can cause request routing to fail repeatedly, manifesting as timeouts that appear application‑level but are actually hint‑driven mis‑routes.

Importance of Pre‑Checks

Before changing any routing‑influencing configuration, establish a known‑good baseline and verify that the system is not already in a failure cascade. Pre‑checks provide:

Skipping pre‑checks turns a controlled remediation into a gamble, risking a local zone problem becoming a cluster‑wide rebalance shock because hints are removed everywhere at once, forcing all nodes to re‑evaluate replica placement simultaneously.


Pre‑Remediation Checks

Network and System Health

  1. Node‑level health – Confirm each node reports UP in gossip and none are DOWN or LEAVING.
    nodetool status | grep -E 'UN|UP'
  2. Inter‑node latency – Measure 95th‑percentile RTT between zones using ping or tcptrace.
    ping -c 20 <node-in-zone-b> | tail -1
  3. Resource saturation – CPU, memory, disk I/O, and network utilization < 70 % on all nodes (adjust per SLA). Use collectd, Prometheus node_exporter, or sar.
  4. Hint statistics – Verify hint counters are non‑zero and trending upward in the affected zone.
    nodetool gossipinfo | grep hint
    # or via JMX: org.apache.cassandra.metrics:type=HintedHandoff,name=TotalHints

Traffic Patterns and Baselines

Current Topology Hint Configuration

If any check fails (node down, latency > 2× baseline, hint counters zero despite timeouts), abort and investigate the underlying cause first.


Designing the Canary Scope

Selecting Representative Nodes

Pick a small, homogeneous subset that mirrors the failure zone:

CriterionReason
Same rack / availability zone as timing‑out trafficReproduces the hint behavior observed in production.
Mixed workload (read‑heavy and write‑heavy)Validates both paths are affected.
CPU < 50 %Reduces chance the canary itself triggers a rebalance.
Same software version and configurationGuarantees parity.

Typical size: 3‑5 nodes (~5 % of a 60‑node cluster) per zone.

Isolating Canary Scope Traffic

  1. Dedicated client profile – Point a small set of test clients (or a canary service) to the canary nodes only via a load‑balancer ACL or DNS override.
  2. Tag the traffic – Use a custom HTTP header (X-Canary: true) or a distinct Cassandra username/password so metrics can be filtered.
  3. Disable hint propagation from canary to non‑canary – Set hinted_handoff_throttle_in_kb: 0 on the canary nodes only (prevents them from sending hints to the rest of the cluster while testing removal).
    # Update cassandra.yaml on canary nodes, then restart
    sudo sed -i 's/^hinted_handoff_throttle_in_kb:.*/hinted_handoff_throttle_in_kb: 0/' /etc/cassandra/cassandra.yaml
    sudo systemctl restart cassandra

Monitoring and Feedback Mechanisms


Implementing Rollback Thresholds

Defining Threshold Metrics

MetricSafe Range (baseline ± X)Rollback Trigger
99th‑pct read latency (ms)≤ baseline × 1.2> baseline × 1.2
99th‑pct write latency (ms)≤ baseline × 1.2> baseline × 1.2
Timeout errors per second≤ baseline × 1.1> baseline × 1.1
Hint count (total)≥ baseline × 0.1 (not completely drained)< baseline × 0.1 for > 2 min
Cluster-wide gossip DOWN count0> 0

These thresholds are operational (based on observed variance), not system guarantees; they rely on the operator to act when breached.

Automated Rollback Triggers

Manual Intervention Points


Executing the Remediation Plan

Step‑by‑Step Procedure

PhaseActionVerification Gate
0 – PrepExport baseline metrics, tag canary traffic, verify health checks.All pre‑checks pass; canary traffic isolated.
1 – Hint Throttle ZeroSet hinted_handoff_throttle_in_kb: 0 on canary nodes (prevents new hints).Hint increase rate drops to ~0 within 2 min (JMX HintedHandoffManager).
2 – Disable Hint PersistenceSet max_hint_window_in_ms: 0 (or comment out) to stop hint storage.No new hint files appear in /var/lib/cassandra/hints.
3 – Flush Existing HintsRun nodetool disablehints (or nodetool flush then nodetool drain on each canary node) to discard in‑flight hints.Hint count reported by JMX drops to zero.
4 – Validate TrafficRun synthetic read/write workload against canary clients for 5 min.Latency & error rates within safe bounds; no timeout spikes.
5 – Roll‑out to Next BatchSelect next 3‑5 nodes (different rack, same zone) and repeat steps 1‑4.Same verification gate; if any gate fails, trigger rollback for all touched nodes.
6 – Full‑Zone SweepAfter all nodes in the affected zone have been processed, remove the per‑node throttle zero and restore default hint TTL (if desired).Cluster‑wide hint metrics show near‑zero; latency stable across zones.
7 – Global Clean‑up (Optional)If keeping hints disabled globally, update global cassandra.yaml and roll a staged restart (same canary pattern) across the entire cluster.Final validation: hint counters remain zero, SLA met.

Code/CLI Examples for Topology Hint Removal

Cassandra (nodetool)

# 1. Disable hint throttle on a node (yaml edit)
sudo sed -i 's/^hinted_handoff_throttle_in_kb:.*/hinted_handoff_throttle_in_kb: 0/' /etc/cassandra/cassandra.yaml
sudo systemctl restart cassandra   # reload if supported, otherwise restart

# 2. Disable hint persistence (max_hint_window)
sudo sed -i 's/^max_hint_window_in_ms:.*/max_hint_window_in_ms: 0/' /etc/cassandra/cassandra.yaml
sudo systemctl restart cassandra

# 3. Flush existing hints (immediate)
nodetool disablehints   # stops accepting new hints
nodetool flush          # forces memtable to SSTable; hints cleared on flush
# Verify
nodetool gossipinfo | grep Hint
# Expected: HintedHandoffManager: ActiveHints=0

ScyllaDB (scylla-cli)

# Truncate hints table
cqlsh -e "TRUNCATE system.hints;"
# Disable hinted handoff via scylla.yaml
sudo sed -i 's/^hinted_handoff_enabled:.*/hinted_handoff_enabled: false/' /etc/scylla/scylla.yaml
sudo systemctl restart scylla

CockroachDB – Cockroach does not use hinted handoff; the analogous knob is kv.rangefeed.enabled. For this article we assume a Cassandra‑style system.

Verification of Successful Removal


Monitoring and Validation

Proof Points for Successful Remediation

  1. Hint Count = 0 for ≥ 5 min across all nodes in the remediated zone.
  2. 99th‑p latency ≤ baseline × 1.05 (no regression).
  3. Timeout rate ≤ baseline × 1.05.
  4. No new hint files created in the hint directory.
  5. Gossip convergence – all nodes report UN (Up Normal) and no LEAVING/JOING states.

If any proof point fails, the rollback trigger must fire.

Identifying and Addressing Local Zone Problems

Preventing Cluster‑Wide Rebalance Shock


Troubleshooting Common Issues

Identifying and Resolving Traffic Timeouts

SymptomLikely CauseDiagnosticFix
Sudden rise in read timeouts after hint removalClients still routing to replicas based on stale hints cached in driverEnable driver‑side logging (com.datastax.driver.core.QueryLogger)Refresh driver metadata (cluster.getMetadata().refresh()) or restart client pods
Write timeouts only in one rackUneven hint distribution causing overloaded replicasnodetool tpstats shows high MutationStage pendingRun nodetool repair on the rack, then consider temporary write‑rate throttling
Hint count stays high despite disablehintsHint files generated faster than flushedCheck system.log for HintedHandoffManager messagesIncrease memtable_flush_writers or reduce write load temporarily

End of document.


Share this post on:

Previous Post
Telemetry-backed verdicts for copilot regression cases
Next Post
Tuning Approval Thresholds by Measured Cost