{"record":{"id":"7998c76647b92231","repo":"apache/cassandra","slug":"index-is-unreadable-scrubbing-will-continue-witho","errorCode":null,"errorMessage":"Index is unreadable, scrubbing will continue without index.","messagePattern":"Index is unreadable, scrubbing will continue without index\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/io/sstable/format/bti/BtiTableScrubber.java","lineNumber":84,"sourceCode":"            this.indexIterator = hasIndexFile\n                                 ? openIndexIterator()\n                                 : null;\n        }\n        catch (RuntimeException ex)\n        {\n            outputHandler.warn(\"Detected corruption in the index file - cannot open index iterator\", ex);\n        }\n    }\n\n    private ScrubPartitionIterator openIndexIterator()\n    {\n        try\n        {\n            return sstable.scrubPartitionsIterator();\n        }\n        catch (Throwable t)\n        {\n            outputHandler.warn(t, \"Index is unreadable, scrubbing will continue without index.\");\n        }\n        return null;\n    }\n\n    @Override\n    protected UnfilteredRowIterator withValidation(UnfilteredRowIterator iter, String filename)\n    {\n        return options.checkData && !isIndex ? UnfilteredRowIterators.withValidation(iter, filename) : iter;\n    }\n\n    @Override\n    public void scrubInternal(SSTableRewriter writer)\n    {\n        if (indexAvailable() && indexIterator.dataPosition() != 0)\n        {\n            outputHandler.warn(\"First position reported by index should be 0, was \" +\n                               indexIterator.dataPosition() +\n                               \", continuing without index.\");","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/io/sstable/format/bti/BtiTableScrubber.java#L66-L102","documentation":"sstable.scrubPartitionsIterator() threw while creating the partition iterator over the BTI index. The scrubber logs the throwable and returns null so scrubbing continues without an index-driven iterator, iterating the data file directly instead.","triggerScenarios":"openIndexIterator (called from BtiTableScrubber constructor) catches any Throwable from scrubPartitionsIterator — unreadable index blocks, I/O errors, or deserialization failures while setting up the partition iterator.","commonSituations":"Severely corrupt -PartitionIndex.db, corrupt index metadata segments, disk I/O errors during open, version mismatch between sstable format and the running Cassandra.","solutions":["Let scrub proceed without the index, then run `nodetool repair` to fix data from replicas","Replace the sstable entirely from a healthy replica (preferable to a degraded scrub)","Verify sstable format version compatibility with the running Cassandra version","Inspect disk I/O health and system logs for underlying hardware faults"],"exampleFix":"// before: iterator open fails, scrub degrades silently\noutputHandler.warn(t, \"Index is unreadable, scrubbing will continue without index.\");\n// after: restore a healthy sstable before scrub\nnodetool repair keyspace table; // replaces corrupt sstable\nnodetool scrub keyspace table;  // scrub now has a valid index","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    return sstable.scrubPartitionsIterator();\n} catch (Throwable t) {\n    logger.warn(\"Index unreadable; scrubbing without index\", t);\n    return null;\n}","preventionTips":["Validate sstables with `nodetool verify` before scrubbing","Repair first so corrupt sstables are replaced by healthy replicas","Check disk I/O health; open failures often indicate hardware issues","Keep sstable format versions compatible with the running node"],"tags":["cassandra","bti","index","iterator"],"backgroundTag":"file-read-failed","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}