apache/cassandra · error
An error occurred while scrubbing the partition with key '%s
Error message
An error occurred while scrubbing the partition with key '%s' for an index table. Scrubbing will abort for this table and the index will be rebuilt.
What it means
When scrubbing an SAI/index-backed table, if a partition belonging to the index's base table fails to scrub and the SSTable is an index table, BigTableScrubber warns and aborts the scrub for that table (throws IOError). The rationale is that a corrupt index table should not be 'repaired' by skipping — dropping and rebuilding the index regenerates it correctly from base data.
Source
Thrown at src/java/org/apache/cassandra/io/sstable/format/big/BigTableScrubber.java:271
catch (Throwable th)
{
throwIfFatal(th);
outputHandler.warn(th, "Failed to seek to next partition position %d", nextPartitionPositionFromIndex);
badPartitions++;
}
updateIndexKey();
}
return false;
}
@Override
protected void throwIfCannotContinue(DecoratedKey key, Throwable th)
{
if (isIndex)
{
outputHandler.warn("An error occurred while scrubbing the partition with key '%s' for an index table. " +
"Scrubbing will abort for this table and the index will be rebuilt.", keyString(key));
throw new IOError(th);
}
super.throwIfCannotContinue(key, th);
}
@Override
public void close()
{
fileAccessLock.writeLock().lock();
try
{
FileUtils.closeQuietly(dataFile);
FileUtils.closeQuietly(indexFile);
}
finally
{View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Let the abort stand (correct behavior), then rebuild the index: ALTER TABLE ... DROP INDEX and re-CREATE the SAI index, or drop/re-add the index column index.
- Scrub the base table separately; index tables are rebuilt from base data so base-table scrubbing should succeed.
- Investigate the corruption source (disk, filesystem, version-specific bugs) before re-running the scrub.
Example fix
// before: scrub aborts on corrupt index SSTable nodetool scrub <keyspace> <table_with_sai> // after: drop and rebuild the index to regenerate index SSTables ALTER TABLE ks.tbl DROP INDEX tbl_idx; CREATE CUSTOM INDEX tbl_idx ON ks.tbl (col) USING 'StorageAttachedIndex';
Defensive patterns
Strategy: fallback
Validate before calling
# Before scrubbing SAI-backed tables, verify index and base SSTables nodetool verify <keyspace> <table_with_sai> nodetool snapshot <keyspace> --table <table_with_sai> # snapshot first
Try / catch
// CLI-level: scrub aborts (IOError) on corrupt index SSTable — expected. // Fallback: DROP INDEX, scrub base table, re-CREATE index to regenerate index SSTables cleanly // ALTER TABLE ks.tbl DROP INDEX idx; // nodetool scrub ks tbl; // CREATE CUSTOM INDEX idx ON ks.tbl (col) USING 'StorageAttachedIndex';
Prevention
- Snapshot before scrubbing any table with SAI indexes.
- Run nodetool verify to find corrupt index SSTables before scrubbing.
- Treat index corruption as rebuildable: prefer DROP/CREATE INDEX over data-skipping scrubs.
- Monitor disk health and repair after unclean shutdowns to prevent index SSTable corruption.
When it happens
Trigger: nodetool scrub on a table with SAI (storage-attached) indexes when a corrupt partition is found in the underlying index SSTable.
Common situations: Disk corruption or torn writes affecting index SSTables; scrubbing after unclean shutdown on tables with SAI indexes.
Understand the failure class
Background: Checksum mismatch errors: "checksum verification failed", "digest mismatch", "expected vs actual checksum" — what they mean and how to fix them — this error's family across 41 libraries.
Related errors
- An error occurred while scrubbing the partition with key '%s
- Error reading partition %s (stacktrace follows):
- Retry failed too. Skipping to next partition (retry's stackt
- SASI indexes are disabled. Enable in cassandra.yaml to use.
- CUSTOM index requires specifiying the index class
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/1ef2f91b8581bb6a.
Report an issue: GitHub.