{"record":{"id":"6c140e25469acb82","repo":"apache/cassandra","slug":"an-incremental-repair-with-session-id-id-finishe","errorCode":null,"errorMessage":"An incremental repair with session id {id} finished during this preview repair runtime","messagePattern":"An incremental repair with session id (.+?) finished during this preview repair runtime","errorType":"exception","errorClass":"RepairException","httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/repair/RepairSession.java","lineNumber":466,"sourceCode":"        Exception exception = new IOException(String.format(\"Endpoint %s died\", endpoint));\n        logger.error(\"{} session completed with the following error\", previewKind.logPrefix(getId()), exception);\n        // If a node failed, we stop everything (though there could still be some activity in the background)\n        forceShutdown(exception);\n    }\n\n    public void onIRStateChange(LocalSession session)\n    {\n        // we should only be registered as listeners for PreviewKind.REPAIRED, but double check here\n        if (previewKind == PreviewKind.REPAIRED &&\n            session.getState() == ConsistentSession.State.FINALIZED &&\n            includesTables(session.tableIds))\n        {\n            for (Range<Token> range : session.ranges)\n            {\n                if (range.intersects(ranges()))\n                {\n                    logger.warn(\"{} An intersecting incremental repair with session id = {} finished, preview repair might not be accurate\", previewKind.logPrefix(getId()), session.sessionID);\n                    forceShutdown(RepairException.warn(\"An incremental repair with session id \"+session.sessionID+\" finished during this preview repair runtime\"));\n                    return;\n                }\n            }\n        }\n    }\n\n    public boolean accordOnly()\n    {\n        return repairData && repairAccord && !repairPaxos;\n    }\n\n    private boolean includesTables(Set<TableId> tableIds)\n    {\n        Keyspace ks = Keyspace.open(state.keyspace);\n        if (ks != null)\n        {\n            for (String table : state.cfnames)\n            {","sourceCodeStart":448,"sourceCodeEnd":484,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/repair/RepairSession.java#L448-L484","documentation":"During a preview (or advisory) repair, if an intersecting incremental repair session finishes while the preview is running, the preview result becomes unreliable (the IR state it was reading changed underneath it). The session force-shuts-down and fails with this RepairException.","triggerScenarios":"onIRStateChange detects a completed incremental repair session whose ranges intersect the preview repair's ranges; the preview coordinator then calls forceShutdown with a RepairException.","commonSituations":"Operators run a preview repair while an incremental repair (started by a schedule or another operator) completes concurrently; overlapping repair schedules in the same keyspace.","solutions":["Re-run the preview repair after the incremental repair has fully finished.","Serialize repair scheduling so incremental and preview repairs don't overlap on the same ranges.","Check repair history (nodetool remedy / repair service logs) to see which IR session raced.","Use incremental repair's own preview (advise vs validate) appropriately: preview kinds that check IR state expect no concurrent IR.","If recurring, fix overlapping cron/automation for repairs."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Check active/finished incremental repairs before previewing:\n// SELECT * FROM system.repairs WHERE state != 'COMPLETED';\n// nodetool adaptations: ensure no overlapping repair runs","typeGuard":null,"tryCatchPattern":"try {\n    previewRepair(keyspace, previewKind);\n} catch (RepairException e) {\n    if (e.getMessage().contains(\"finished during this preview repair runtime\")) {\n        // wait for IR completion, then re-run preview\n    }\n}","preventionTips":["Serialize preview and incremental repair schedules on the same keyspaces.","Gate repair automation on system.repairs state.","Avoid overlapping repair jobs from multiple schedulers.","Re-run preview after any concurrent IR finishes; results are otherwise unreliable."],"tags":["repair","incremental-repair","preview","cassandra"],"backgroundTag":"repair-session-failed","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"}