{"record":{"id":"54999dd4543faa0b","repo":"apache/cassandra","slug":"prepare-phase-for-incremental-repair-session-s-ha","errorCode":null,"errorMessage":"Prepare phase for incremental repair session %s has failed because it encountered intersecting sstables belonging to another incremental repair session (%s). This is caused by starting an incremental repair session before a previous one has completed. Check nodetool repair_admin for hung sessions and fix them.","messagePattern":"Prepare phase for incremental repair session (.+?) has failed because it encountered intersecting sstables belonging to another incremental repair session \\((.+?)\\)\\. This is caused by starting an incremental repair session before a previous one has completed\\. Check nodetool repair_admin for hung sessions and fix them\\.","errorType":"exception","errorClass":"SSTableAcquisitionException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/db/repair/PendingAntiCompaction.java","lineNumber":146,"sourceCode":"            if (!sstable.descriptor.version.hasPendingRepair())\n            {\n                String message = String.format(\"Prepare phase failed because it encountered legacy sstables that don't \" +\n                                               \"support pending repair, run upgradesstables before starting incremental \" +\n                                               \"repairs, repair session (%s)\", prsid);\n                throw new SSTableAcquisitionException(message);\n            }\n\n            // exclude sstables pending repair, but record session ids for\n            // non-finalized sessions for a later error message\n            if (metadata.pendingRepair != NO_PENDING_REPAIR)\n            {\n                if (!ActiveRepairService.instance().consistent.local.isSessionFinalized(metadata.pendingRepair))\n                {\n                    String message = String.format(\"Prepare phase for incremental repair session %s has failed because it encountered \" +\n                                                   \"intersecting sstables belonging to another incremental repair session (%s). This is \" +\n                                                   \"caused by starting an incremental repair session before a previous one has completed. \" +\n                                                   \"Check nodetool repair_admin for hung sessions and fix them.\", prsid, metadata.pendingRepair);\n                    throw new SSTableAcquisitionException(message);\n                }\n                return false;\n            }\n            Collection<CompactionInfo> cis = CompactionManager.instance.active.getCompactionsForSSTable(sstable, OperationType.ANTICOMPACTION);\n            if (cis != null && !cis.isEmpty())\n            {\n                // todo: start tracking the parent repair session id that created the anticompaction to be able to give a better error messsage here:\n                StringBuilder sb = new StringBuilder();\n                sb.append(\"Prepare phase for incremental repair session \");\n                sb.append(prsid);\n                sb.append(\" has failed because it encountered intersecting sstables belonging to another incremental repair session. \");\n                sb.append(\"This is caused by starting multiple conflicting incremental repairs at the same time. \");\n                sb.append(\"Conflicting anticompactions: \");\n                for (CompactionInfo ci : cis)\n                    sb.append(ci.getTaskId() == null ? \"no compaction id\" : ci.getTaskId()).append(':').append(ci.getSSTables()).append(',');\n                throw new SSTableAcquisitionException(sb.toString());\n            }\n            return true;","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/repair/PendingAntiCompaction.java#L128-L164","documentation":"Incremental repair requires that sstables intersecting the repair range belong to no other unfinished repair session. When the prepare phase finds an intersecting sstable whose pendingRepair id belongs to another session that is not finalized, it throws SSTableAcquisitionException with this message indicating an overlapping incremental repair was started before the previous one completed.","triggerScenarios":"Starting a new incremental repair on a token range while a previous incremental repair session over the same range is still running or hung (never finalized); crashed repair sessions leaving sstables with dangling pendingRepair ids.","commonSituations":"Overlapping scheduled repairs (e.g. cron firing while a manual repair runs); hung repair sessions after node restarts/failures; repair timeouts leaving unfinalized sessions.","solutions":["Run 'nodetool repair_admin list' to find hung sessions and 'nodetool repair_admin cleanup' (fail the sessions) for stale ones","Wait for the current incremental repair to complete before starting another on overlapping ranges","Fix scheduling so incremental repairs over the same ranges never overlap","After cleanup, re-run the repair; consider full (non-incremental) repair to reset pendingRepair state if sessions are badly stuck"],"exampleFix":"// before\nnodetool repair -inc ks   # previous session still hung\n// after\nnodetool repair_admin list\nnodetool repair_admin cleanup --force\nnodetool repair -inc ks","handlingStrategy":"validation","validationCode":"// shell: check for un-finalized sessions before starting repair\nnodetool repair_admin list","typeGuard":null,"tryCatchPattern":"try { repairService.submitIncremental(); } catch (Exception e) { if (e.getMessage().contains(\"another incremental repair session\")) { cleanupHungSessions(); retry(); } else throw e; }","preventionTips":["Never overlap incremental repairs on the same ranges","Alert on repair sessions that exceed expected duration","Use repair_admin to clean up sessions after node failures"],"tags":["cassandra","repair","incremental-repair","conflict","session"],"backgroundTag":"conflicting-operation-in-progress","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"}