{"record":{"id":"a78e34adc5eb133e","repo":"apache/cassandra","slug":"no-valid-partitions-found-while-scrubbing-s-it-i","errorCode":null,"errorMessage":"No valid partitions found while scrubbing %s; it is marked for deletion now. If you want to attempt manual recovery, you can find a copy in the pre-scrub snapshot","messagePattern":"No valid partitions found while scrubbing (.+?); it is marked for deletion now\\. If you want to attempt manual recovery, you can find a copy in the pre-scrub snapshot","errorType":"console","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src/java/org/apache/cassandra/io/sstable/format/SortedTableScrubber.java","lineNumber":232,"sourceCode":"        outputSummary(finished);\n    }\n\n    protected abstract void scrubInternal(SSTableRewriter writer) throws IOException;\n\n    private void outputSummary(List<SSTableReader> finished)\n    {\n        if (!finished.isEmpty())\n        {\n            outputHandler.output(\"Scrub of %s complete: %d partitions in new sstable and %d empty (tombstoned) partitions dropped\", sstable, goodPartitions, emptyPartitions);\n            if (negativeLocalDeletionInfoMetrics.fixedRows > 0)\n                outputHandler.output(\"Fixed %d rows with overflowed local deletion time.\", negativeLocalDeletionInfoMetrics.fixedRows);\n            if (badPartitions > 0)\n                outputHandler.warn(\"Unable to recover %d partitions that were skipped.  You can attempt manual recovery from the pre-scrub snapshot.  You can also run nodetool repair to transfer the data from a healthy replica, if any\", badPartitions);\n        }\n        else\n        {\n            if (badPartitions > 0)\n                outputHandler.warn(\"No valid partitions found while scrubbing %s; it is marked for deletion now. If you want to attempt manual recovery, you can find a copy in the pre-scrub snapshot\", sstable);\n            else\n                outputHandler.output(\"Scrub of %s complete; looks like all %d partitions were tombstoned\", sstable, emptyPartitions);\n        }\n    }\n\n    private SSTableReader writeOutOfOrderPartitions(StatsMetadata metadata)\n    {\n        // out of order partitions/rows, but no bad partition found - we can keep our repairedAt time\n        long repairedAt = badPartitions > 0 ? ActiveRepairService.UNREPAIRED_SSTABLE : sstable.getSSTableMetadata().repairedAt;\n        SSTableReader newInOrderSstable;\n        try (SSTableWriter inOrderWriter = CompactionManager.createWriter(cfs, destination, expectedBloomFilterSize, repairedAt, metadata.pendingRepair, metadata.isTransient, sstable, transaction))\n        {\n            for (Partition partition : outOfOrder)\n                inOrderWriter.append(partition.unfilteredIterator());\n            inOrderWriter.setRepairedAt(-1);\n            inOrderWriter.setMaxDataAge(sstable.maxDataAge);\n            newInOrderSstable = inOrderWriter.finish(true);\n        }","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/io/sstable/format/SortedTableScrubber.java#L214-L250","documentation":"outputSummary warns when a scrub found zero valid partitions and at least one bad partition: the entire sstable was unreadable, so no replacement sstable is produced and the original is marked for deletion. The pre-scrub snapshot is the only remaining copy on this node; recovery otherwise depends on other replicas.","triggerScenarios":"nodetool scrub on an sstable where every partition fails parsing/validation (badPartitions > 0 && finished.isEmpty()) — typically severe or total file corruption.","commonSituations":"Totally truncated or overwritten data file; filesystem corruption; restoring mismatched/incompatible sstable files from a bad backup.","solutions":["Immediately run nodetool repair (or a full rebuild) so other replicas restore the data","Before the sstable is purged, copy the pre-scrub snapshot elsewhere for possible manual salvage","Investigate storage health — total corruption usually indicates disk/filesystem failure","If replication factor was 1 with no backup, the data may be unrecoverable; assess from backups"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Treat total-scrub-failure as an incident:\nif (scrubReport.goodPartitions == 0 && scrubReport.badPartitions > 0) { preserveSnapshot(); pageOnCall(); startRepair(); }","preventionTips":["Never run scrub without a recent snapshot or healthy replicas","Avoid RF=1 for critical data — unrecoverable corruption risk","Monitor filesystem/disk errors proactively","Keep backups of sstables off-node"],"tags":["scrub","data-corruption","data-loss","sstable"],"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"}