{"record":{"id":"a082ddb140cc847a","repo":"apache/cassandra","slug":"invalid-sstable-s-please-force-srepair","errorCode":null,"errorMessage":"Invalid SSTable %s, please force %srepair","messagePattern":"Invalid SSTable (.+?), please force (.+?)repair","errorType":"exception","errorClass":"CorruptSSTableException","httpStatus":null,"severity":"critical","filePath":"src/java/org/apache/cassandra/io/sstable/format/SortedTableVerifier.java","lineNumber":142,"sourceCode":"    }\n\n    protected void markAndThrow(Throwable cause, boolean mutateRepaired)\n    {\n        if (mutateRepaired && options.mutateRepairStatus) // if we are able to mutate repaired flag, an incremental repair should be enough\n        {\n            try\n            {\n                sstable.mutateRepairedAndReload(ActiveRepairService.UNREPAIRED_SSTABLE, sstable.getPendingRepair(), sstable.isTransient());\n                cfs.getTracker().notifySSTableRepairedStatusChanged(Collections.singleton(sstable));\n            }\n            catch (IOException ioe)\n            {\n                outputHandler.output(\"Error mutating repairedAt for SSTable %s, as part of markAndThrow\", sstable.getFilename());\n            }\n        }\n        Exception e = new Exception(String.format(\"Invalid SSTable %s, please force %srepair\", sstable.getFilename(), (mutateRepaired && options.mutateRepairStatus) ? \"\" : \"a full \"), cause);\n        if (options.invokeDiskFailurePolicy)\n            throw new CorruptSSTableException(e, sstable.getFilename());\n        else\n            throw new RuntimeException(e);\n    }\n\n    public void verify()\n    {\n        verifySSTableVersion();\n\n        verifySSTableMetadata();\n\n        verifyIndex();\n\n        verifyBloomFilter();\n\n        // TODO: when making it possible to clean up system_cluster_metadata, we should make sure that non-cms members don't have any sstables there\n        if (options.checkOwnsTokens && !isOffline && !(cfs.getPartitioner() instanceof LocalPartitioner) && !(cfs.getPartitioner() == MetaStrategy.partitioner))\n        {\n            if (verifyOwnedRanges() == 0)","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/io/sstable/format/SortedTableVerifier.java#L124-L160","documentation":"SortedTableVerifier.markAndThrow() builds an exception reporting that SSTable verification failed, telling the operator to run either a regular repair or a full repair (depending on mutateRepaired/mutateRepairStatus options). If invokeDiskFailurePolicy is set it escalates to CorruptSSTableException (triggering disk-failure policy), otherwise a plain RuntimeException wrapping the underlying cause.","triggerScenarios":"Running nodetool verify / sstable verify when the SSTable fails integrity checks (checksums, index consistency, key order) via verifySSTableMetadata or markAndThrow recursion — indicating detected corruption in the data/index components.","commonSituations":"Bit rot or failing disks corrupting SSTables; post-power-loss corruption detection; routine verification sweeps finding files damaged months earlier; verifying after suspicious node behavior.","solutions":["Run nodetool repair (or a full repair if mutateRepairStatus was used) to restore data from replicas, then re-verify","Run nodetool scrub to move corrupted rows out and quarantine the bad SSTable","Replace the failing disk / check hardware (SMART, dmesg) since corruption is often physical","Remove the corrupted SSTable after confirming replica coverage via repair"],"exampleFix":"# before: ignoring verify failures\nnodetool verify ks tbl || true\n# after: verify, then repair and re-verify\nnodetool verify ks tbl || (nodetool repair -full ks tbl && nodetool verify ks tbl)","handlingStrategy":"try-catch","validationCode":"// run verification proactively before mark/reliance\nnodetool verify ks tbl\n// or programmatically:\nnew SortedTableVerifier(cfs, sstable, options, handler, false).verify();","typeGuard":null,"tryCatchPattern":"try { verifier.verify(); }\ncatch (RuntimeException e) {\n    if (e.getMessage().contains(\"please force\") && e.getMessage().contains(\"repair\")) {\n        logger.error(\"Corrupt sstable detected: {}\", e.getCause());\n        runRepair(keyspace, table, /*full=*/ true);\n    } else throw e;\n}","preventionTips":["Schedule regular nodetool verify across all tables","Verify after any suspicion of disk issues or power loss","Run repairs on schedule so corrupt data can be restored from replicas","Monitor disk SMART metrics and replace degrading hardware early"],"tags":["sstable","corruption","verification","repair"],"backgroundTag":"checksum-mismatch","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}