apache/cassandra · warning
Missing index component
Error message
Missing index component
What it means
When constructing a BTI-format scrubber, the sstable's PARTITION_INDEX component is absent. The scrubber warns 'Missing index component' and scrubs without the partition index, losing the ability to validate or skip partitions using index positions.
Solutions
- Restore the -PartitionIndex.db from a snapshot or stream the sstable from a replica
- Run `nodetool repair` so a healthy replica replaces the sstable
- Proceed with scrub knowing partitions cannot be index-validated (corrupt partitions can't be skipped)
- Rebuild the node if many sstables lack components
Example fix
// before: scrubbing BTI sstable without partition index
outputHandler.warn("Missing index component");
// after: pre-flight component check
if (!sstable.getComponents().contains(Components.PARTITION_INDEX))
throw new IllegalStateException("Restore PARTITION_INDEX before scrubbing " + sstable); Defensive patterns
Strategy: validation
Validate before calling
Set<Component> comps = sstable.getComponents();
if (!comps.contains(Components.PARTITION_INDEX))
throw new IllegalStateException(sstable + " lacks PARTITION_INDEX; restore from snapshot/replica before scrub"); Prevention
- Copy sstables as whole directory sets (all components)
- Use `nodetool snapshot`/restore flows instead of ad-hoc file moves
- Run `nodetool verify` before scrub to catch missing components
- Never manually prune sstable files on disk
When it happens
Trigger: BtiTableScrubber constructor: sstable.getComponents().contains(Components.PARTITION_INDEX) is false — the -PartitionIndex.db file is missing from the sstable's files on disk.
Common situations: Incomplete restores/backups, manual deletion of index files, moving sstables between nodes with missing components, failed writes leaving partial sstables.
Understand the failure class
Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.
Related errors
- Cannot remove temporary or obsoleted files for
- Cannot remove temporary or obsoleted files for
- Corrupt flags value for clustering prefix (isStatic flag…
- Could not reference sstables
- Data file partition position
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/87af7f7ffd3045f0.
Report an issue: GitHub.
Appendix: source
Thrown at src/java/org/apache/cassandra/io/sstable/format/bti/BtiTableScrubber.java:61
{
private final boolean isIndex;
private final AbstractType<?> partitionKeyType;
private ScrubPartitionIterator indexIterator;
public BtiTableScrubber(ColumnFamilyStore cfs,
LifecycleTransaction transaction,
OutputHandler outputHandler,
IScrubber.Options options)
{
super(cfs, transaction, outputHandler, options);
boolean hasIndexFile = sstable.getComponents().contains(Components.PARTITION_INDEX);
this.isIndex = cfs.isIndex();
this.partitionKeyType = cfs.metadata.get().partitionKeyType;
if (!hasIndexFile)
{
// if there's any corruption in the -Data.db then partitions can't be skipped over. but it's worth a shot.
outputHandler.warn("Missing index component");
}
try
{
this.indexIterator = hasIndexFile
? openIndexIterator()
: null;
}
catch (RuntimeException ex)
{
outputHandler.warn("Detected corruption in the index file - cannot open index iterator", ex);
}
}
private ScrubPartitionIterator openIndexIterator()
{
try
{View on GitHub (pinned to 88fd0f6a0e)