nodetool listpendinghints
Cassandra 4.1+
This command is available in Cassandra 4.1 and later.
Lists the pending hints for each node in the cluster.
Synopsis
Section titled “Synopsis”nodetool [connection_options] listpendinghintsSee connection options for connection options.
Description
Section titled “Description”nodetool listpendinghints displays information about hints that are waiting to be delivered to their target nodes. Hints are stored when a write cannot reach all replica nodes, and are delivered when those nodes become available again.
This command helps monitor hint backlog and identify nodes that may have been unavailable.
Examples
Section titled “Examples”Basic Usage
Section titled “Basic Usage”nodetool listpendinghintsOutput
Section titled “Output”Sample Output
Section titled “Sample Output”Host ID Hints12345678-1234-1234-1234-123456789abc 152387654321-4321-4321-4321-cba987654321 42abcdef12-3456-7890-abcd-ef1234567890 0Output Fields
Section titled “Output Fields”| Field | Description |
|---|---|
| Host ID | UUID of the target node |
| Hints | Number of pending hints for that node |
Use Cases
Section titled “Use Cases”Monitor Hint Backlog
Section titled “Monitor Hint Backlog”# Check pending hintsnodetool listpendinghints
# High numbers indicate recent node unavailabilityAfter Node Recovery
Section titled “After Node Recovery”Verify hints are being delivered:
# Check hints before and afternodetool listpendinghints
# Wait and check againsleep 60nodetool listpendinghints
# Counts should decrease as hints are deliveredTroubleshoot Consistency
Section titled “Troubleshoot Consistency”When investigating data inconsistencies:
# Large hint counts for a node suggest recent outagenodetool listpendinghints
# Consider running repair if hints are oldMonitoring Script
Section titled “Monitoring Script”#!/bin/bashTHRESHOLD=10000
echo "=== Pending Hints Check ==="
total_hints=0nodetool listpendinghints | tail -n +2 | while read host_id hints; do total_hints=$((total_hints + hints))
if [ "$hints" -gt "$THRESHOLD" ]; then echo "WARNING: $host_id has $hints pending hints" elif [ "$hints" -gt 0 ]; then echo "INFO: $host_id has $hints pending hints" fidone
echo ""echo "Total pending hints: $total_hints"Cluster-Wide Check
Section titled “Cluster-Wide Check”#!/bin/bashecho "=== Cluster Pending Hints ==="
# Get list of node IPs from local nodetool statusnodes=$(nodetool status | grep "^UN" | awk '{print $2}')
for node in $nodes; do echo "" echo "=== Hints on $node ===" ssh "$node" 'nodetool listpendinghints 2>/dev/null | tail -n +2 | awk "{sum+=\$2} END {print \"Total:\", sum}"'doneUnderstanding Hints
Section titled “Understanding Hints”Hint Lifecycle
Section titled “Hint Lifecycle”1. Write received by coordinator2. Replica unreachable → hint stored locally3. Replica recovers → hint delivered4. Successful delivery → hint deletedHint Window
Section titled “Hint Window”Hints are only stored for nodes that have been down less than the hint window. The cassandra.yaml parameter name varies by version:
| Cassandra Version | Parameter Name | Example |
|---|---|---|
| Pre-4.1 | max_hint_window_in_ms | 10800000 (3 hours) |
| 4.1+ | max_hint_window | 3h |
# cassandra.yaml (4.1+)max_hint_window: 3h
# cassandra.yaml (Pre-4.1)# max_hint_window_in_ms: 10800000Troubleshooting
Section titled “Troubleshooting”Large Hint Backlog
Section titled “Large Hint Backlog”# Check which nodes have pending hintsnodetool listpendinghints
# Check if target nodes are UPnodetool status
# If target is UP but hints not delivering, check:nodetool tpstats | grep -i hintHints Not Decreasing
Section titled “Hints Not Decreasing”# Check hint delivery statusnodetool statushandoff
# Ensure delivery is not pausednodetool resumehandoff
# Check for delivery errorsgrep -i "hint" /var/log/cassandra/system.log | tail -20Hints Growing Despite Healthy Cluster
Section titled “Hints Growing Despite Healthy Cluster”# May indicate network issues# Check connectivity to target nodesnodetool status
# Check for intermittent failuresnodetool failuredetectorHints and Consistency
Section titled “Hints and Consistency”| Scenario | Hints | Consistency |
|---|---|---|
| Hints delivered | Decreasing | Being restored |
| Hints stale (expired) | May show 0 | Requires repair |
| Hints accumulating | Increasing | Target node down |
Hint Expiration
Hints older than max_hint_window are dropped. If a node was down longer than this window, use nodetool repair to restore consistency.
Best Practices
Section titled “Best Practices”Hint Monitoring Guidelines
- Regular checks - Include in monitoring
- Alert on high counts - May indicate failing nodes
- Watch trends - Increasing hints = problem
- Repair after long outages - Don't rely on hints alone
- Size hint storage - Ensure adequate disk for hints
Normal Behavior
- Small hint counts are normal during temporary outages
- Hints should decrease as target nodes recover
- Zero hints is ideal but brief non-zero is okay
Related Commands
Section titled “Related Commands”| Command | Relationship |
|---|---|
| truncatehints | Remove all pending hints |
| statushandoff | Check handoff status |
| pausehandoff | Pause hint delivery |
| resumehandoff | Resume hint delivery |
| repair | Restore consistency |