{"record":{"id":"be1806b3e507289d","repo":"apache/cassandra","slug":"sstable-s-is-marked-pending-for-non-finalized-inc","errorCode":null,"errorMessage":"SSTable %s is marked pending for non-finalized incremental repair session %s, failing preview repair","messagePattern":"SSTable (.+?) is marked pending for non-finalized incremental repair session (.+?), failing preview repair","errorType":"exception","errorClass":"PreviewRepairConflictWithIncrementalRepairException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/streaming/PreviewKind.java","lineNumber":95,"sourceCode":"    {\n        return predicate;\n    }\n\n    private static class PreviewRepairedSSTablePredicate implements Predicate<SSTableReader>\n    {\n        public boolean apply(SSTableReader sstable)\n        {\n            // grab the metadata before checking pendingRepair since this can be nulled out at any time\n            StatsMetadata sstableMetadata = sstable.getSSTableMetadata();\n            if (sstableMetadata.pendingRepair != null)\n            {\n                LocalSession session = ActiveRepairService.instance().consistent.local.getSession(sstableMetadata.pendingRepair);\n                if (session == null)\n                    return false;\n                else if (session.getState() == ConsistentSession.State.FINALIZED)\n                    return true;\n                else if (session.getState() != ConsistentSession.State.FAILED)\n                    throw new PreviewRepairConflictWithIncrementalRepairException(String.format(\"SSTable %s is marked pending for non-finalized incremental repair session %s, failing preview repair\", sstable, sstableMetadata.pendingRepair));\n            }\n            return sstableMetadata.repairedAt != ActiveRepairService.UNREPAIRED_SSTABLE;\n        }\n    }\n}\n","sourceCodeStart":77,"sourceCodeEnd":101,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/streaming/PreviewKind.java#L77-L101","documentation":"PreviewKind's repaired-check (used when previewing repair, e.g. preview-repair-repaired or parent-repair preview) throws PreviewRepairConflictWithIncrementalRepairException when an SSTable is marked pending for an incremental repair LocalSession that is neither FINALIZED nor FAILED. Preview repair cannot meaningfully classify such SSTables — they belong to an in-flight incremental repair — so the operation fails fast instead of returning misleading results.","triggerScenarios":"Running nodetool repair --preview (or validate/preview kinds) on ranges containing SSTables with pendingRepair set from a still-active incremental repair session; mixing preview repair and incremental repair concurrently on overlapping ranges.","commonSituations":"Operators running preview after cancelling but before incremental repair sessions fully fail/finalize; scheduled preview repairs overlapping incremental repair windows; leaked pendingRepair states from crashed incremental repair sessions.","solutions":["Wait for the incremental repair session to reach FINALIZED or FAILED (check nodetool netstats / system.repairs) then retry the preview.","Abort or let the in-flight incremental repair finish before running preview repair on the same tables.","For genuinely stuck sessions, fail the session (nodetool failrepairedata / consistent repair management) so SSTables are released, then re-run preview; avoiding mixing preview and incremental repair on the same ranges prevents recurrence."],"exampleFix":"// before\nnodetool repair -pr keyspace1 --preview   # while incremental repair running\n// after\n# wait for incremental repair completion\nnodetool repair -pr keyspace1 --preview","handlingStrategy":"retry","validationCode":"// ensure no incremental repair session is active on target tables\nfor (SSTableReader s : table.getLiveSSTables())\n    if (s.isPendingRepair()) throw new IllegalStateException(\"pending incremental repair SSTables present\");","typeGuard":null,"tryCatchPattern":"try { repair(previewKind); } catch (PreviewRepairConflictWithIncrementalRepairException e) { waitUntilSessionsSettled(); repair(previewKind); }","preventionTips":["Never run preview repair concurrently with incremental repair on the same ranges","Monitor system.repairs and wait for FINALIZED/FAILED before previewing","Alert on stuck incremental repair sessions that leak pendingRepair SSTables"],"tags":["repair","preview-repair","incremental-repair","sstable"],"backgroundTag":"conflicting-config-options","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}