Skip to content

AxonOps — AI-Native Control Plane for Open Source Data Platforms

nodetool truncatehints

Removes all pending hints from this node.


Terminal window
nodetool [connection_options] truncatehints [endpoint]

See connection options for connection options.

nodetool truncatehints deletes stored hints on this node. Hints are writes stored temporarily when a replica is unavailable, to be replayed when the replica recovers. Truncating hints discards these pending writes.


ArgumentDescription
endpointOptional. Only truncate hints for this specific endpoint IP

Terminal window
nodetool truncatehints
Terminal window
nodetool truncatehints 192.168.1.105

When a node is removed and won't return:

Terminal window
# After removing node 192.168.1.105
nodetool truncatehints 192.168.1.105

Hints for removed nodes will never be delivered.

When hints have accumulated excessively:

Terminal window
# Check hint status
nodetool tpstats | grep -i hint
# If backlog is causing issues
nodetool truncatehints

When replacing a node (new node, same IP):

Terminal window
# Truncate hints for the old node
nodetool truncatehints 192.168.1.105
# Then add replacement node

Data Loss Warning

Truncating hints means:

  • Pending writes will NOT be delivered
  • Data may become inconsistent
  • Only use when recovery isn't possible or desired
  • Node is temporarily down and will recover
  • You want to preserve data consistency
  • During normal operations

When a write fails to reach a replica:

  1. Coordinator stores the write as a "hint"
  2. Hint includes: mutation data + target endpoint
  3. When target recovers, hints are replayed

Hints are stored in:

/var/lib/cassandra/hints/
Terminal window
# See hint delivery status
nodetool tpstats | grep -i hint
# List hint files
ls -la /var/lib/cassandra/hints/

ScenarioImpact
Target node returnsMissed writes not recovered (run repair)
Target node replacedOld hints not needed anyway
Target node removedHints would never deliver

If hints are truncated but data consistency is needed:

Terminal window
# Run repair to restore consistency
nodetool repair -pr keyspace

Related settings in cassandra.yaml:

Setting (4.1+)Setting (Pre-4.1)DefaultDescription
max_hint_windowmax_hint_window_in_ms3h / 10800000Stop hinting after this duration
hinted_handoff_enabledhinted_handoff_enabledtrueWhether hints are created
hints_directoryhints_directory$DATA/hintsHint storage location

Terminal window
# 1. Check if node has pending hints
nodetool tpstats | grep -i hint
# 2. If removing node permanently, truncate its hints
nodetool truncatehints <removed_node_ip>
# 3. Run repair to ensure consistency
nodetool repair -pr

Terminal window
# Check hint backlog
nodetool tpstats | grep HintedHandoff
# Check hint files size
du -sh /var/lib/cassandra/hints/
Terminal window
# Verify hints removed
ls -la /var/lib/cassandra/hints/
# Confirm empty
nodetool tpstats | grep HintedHandoff

Node has been down for days:

Terminal window
# Check hints accumulated
du -sh /var/lib/cassandra/hints/
# If node won't return, truncate
nodetool truncatehints 192.168.1.105
# Run repair on recovered node instead

Hints filling disk:

Terminal window
# Emergency truncation
nodetool truncatehints
# Then run repairs
nodetool repair -pr

Replacing dead node with new hardware:

Terminal window
# Truncate hints for old node
nodetool truncatehints 192.168.1.105
# Bootstrap new node with same tokens
# Run repair after bootstrap

Hint Management

  1. Prefer repair over truncation - Repair recovers data properly
  2. Truncate only for removed nodes - Hints to removed nodes are useless
  3. Monitor hint growth - Large hint backlogs indicate problems
  4. Repair after truncation - Restore consistency
  5. Consider max_hint_window - Tune to match your SLA

CommandRelationship
tpstatsCheck hint delivery status
repairRestore consistency after truncation
removenodeRemove dead nodes (truncate hints after)
decommissionGraceful node removal