Skip to content

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

nodetool verify

Verifies SSTable integrity without modifying data.


Terminal window
nodetool [connection_options] verify [options] [--] [keyspace [table ...]]

See connection options for connection options.

nodetool verify performs a non-destructive check of SSTable integrity. Unlike scrub, verify only reads and validates—it never modifies data. Use verify to detect corruption before deciding whether to run scrub.

Force Flag Required

By default, the command exits with an error unless the -f/--force flag is provided. This is a safety mechanism to ensure operators understand the I/O impact of verification.

The verify command performs integrity checks by reading SSTable files and validating their internal consistency:

  1. Checksum Validation - Each SSTable has an associated digest file (*-Digest.crc32) containing a checksum of the entire Data.db file. Verify reads the data file, computes a fresh checksum, and compares it against the stored digest. A mismatch indicates data corruption from disk errors, incomplete writes, or bit rot.

  2. Partition Key Ordering - SSTables store partitions in sorted token order. Verify confirms that partition keys appear in strictly ascending token order. Out-of-order keys indicate structural corruption.

  3. Clustering Column Ordering - Within each partition, rows must be sorted by clustering columns. Verify validates this ordering to detect intra-partition corruption.

  4. Index Consistency - The SSTable index (*-Index.db) contains offsets to partition locations in the data file. Verify confirms that index entries point to valid partition boundaries and that all partitions are indexed.

  5. Bloom Filter Validation - Checks that the Bloom filter file (*-Filter.db) is readable and structurally valid.

  6. Compression Metadata - For compressed SSTables, validates the compression offset map (*-CompressionInfo.db) which maps logical offsets to compressed chunk locations.

SSTable Verification ProcessSSTable Verification ProcessSelect SSTable files to verifyFile-Level ValidationRead Data.db fileCompute checksum of entire fileCompare against Digest.crc32Checksum matches?yesnoFile integrity confirmedLog corruption errorStructural ValidationParse partitions sequentiallyRead partition keyVerify token > previous tokenToken order valid?yesnoCheck clustering column orderLog ordering erroryesMore partitions?noComponent ValidationValidate Index.db(partition offsets)Validate Filter.db(Bloom filter structure)Validate CompressionInfo.db(chunk offset map)yesSSTable compressed?Any errors detected?yesnoReport corrupted SSTablesExit with error codeVerification successful

Cassandra uses different checksum mechanisms depending on whether SSTables are compressed:

SSTable TypeChecksum FileChecksum ScopeRead-Time Verification
Uncompressed*-Digest.crc32Entire Data.db filePer-file during verify
Compressed*-Digest.crc32 + *-CompressionInfo.dbEntire file + per-chunk metadataPer-chunk during reads

Compression and Data Integrity

Compressed SSTables (the default) provide per-chunk verification during normal reads, controlled by the crc_check_chance table option (default 1.0 = 100%). This is Cassandra's primary defense against bit rot. The nodetool verify command performs a complete scan regardless of this setting.


ArgumentDescription
keyspaceKeyspace to verify. If omitted, verifies all keyspaces
tableSpecific table(s) to verify

OptionDescription
-f, --forceRequired. Force verification to proceed
-e, --extended-verifyExtended verification (checks all components)
-c, --check-versionCheck SSTable version compatibility
-d, --dfpInvoke disk failure policy on failure
-r, --rscMutate repairedAt, pendingRepair, and repairedSessionColumn
-t, --check-tokensVerify tokens are within node's ranges (requires -e)
-q, --quickQuick check (fewer validations)
-s, --sai-onlyVerify only Storage-Attached Indexes (SAI)
-i, --include-saiInclude SAI verification along with SSTable verification

Option Dependencies

The --check-tokens option requires --extended-verify to be specified.


  • Partition key ordering
  • Clustering column ordering
  • SSTable file checksums
  • Index consistency
  • Bloom filter validity

Extended Verification (-e/--extended-verify)

Section titled “Extended Verification (-e/--extended-verify)”
  • All data component files
  • Compression metadata
  • Statistics file integrity
  • Summary file consistency
  • TOC file completeness
  • Token range validation (when -t also specified)

Terminal window
nodetool verify -f my_keyspace my_table
Terminal window
nodetool verify -f my_keyspace
Terminal window
nodetool verify -f -e my_keyspace my_table
Terminal window
nodetool verify -f -q my_keyspace
Terminal window
# Note: -t requires -e (extended-verify)
nodetool verify -f -e -t my_keyspace my_table
Terminal window
nodetool verify -f -s my_keyspace my_table
Terminal window
nodetool verify -f -i my_keyspace my_table

Completed verification of my_keyspace.my_table
ERROR: Corrupted SSTable: /var/lib/cassandra/data/my_keyspace/my_table-abc123/nb-1-big-Data.db
- Invalid partition key at position 12345
- Checksum mismatch in Data.db

Terminal window
# Regular integrity check (e.g., weekly)
nodetool verify -f my_keyspace
Terminal window
# After seeing I/O errors in logs
nodetool verify -f
Terminal window
# Verify before backup
nodetool verify -f my_keyspace
nodetool snapshot -t pre_backup my_keyspace
Terminal window
# After crash or power loss
nodetool verify -f

Verify ResultAction
No errorsNo action needed
Errors foundRun nodetool scrub to fix
Scrub failsRun nodetool scrub -s (skips corrupted)
After scrub -sRun nodetool repair to recover data

Read-Only Operation

Verify is read-only but still I/O intensive:

  • Reads all SSTable data files
  • Computes checksums
  • No writes or modifications
  • Lower impact than scrub
Table SizeApproximate Time
10 GB5-15 minutes
100 GB30-90 minutes
1 TB5-10 hours

#!/bin/bash
# verify_all.sh - Weekly verification
LOG="/var/log/cassandra/verify_$(date +%Y%m%d).log"
echo "Starting verification at $(date)" >> $LOG
for ks in $(nodetool tablestats | grep "Keyspace:" | awk '{print $2}'); do
echo "Verifying $ks..." >> $LOG
nodetool verify -f $ks >> $LOG 2>&1
done
echo "Completed at $(date)" >> $LOG
# Alert on errors
if grep -q "ERROR" $LOG; then
echo "Verification errors found - check $LOG"
fi

Verify needs memory for checksums:

Terminal window
# Run on one table at a time
nodetool verify -f my_keyspace table1
nodetool verify -f my_keyspace table2
Terminal window
# Use quick mode for faster check
nodetool verify -f -q my_keyspace
# Or verify specific tables only
nodetool verify -f my_keyspace critical_table

Verification Guidelines

  1. Run regularly - Weekly or after incidents
  2. Check before backup - Ensure clean backups
  3. Use extended mode periodically - Thorough check
  4. Monitor duration - Baseline normal verification time
  5. Act on findings - Follow up with scrub if needed

CommandRelationship
scrubFix corruption found by verify
repairRecover data after scrub with skip
tablestatsCheck table health metrics
snapshotBackup after successful verify