{"record":{"id":"3f1d4bacdfef00c1","repo":"apache/cassandra","slug":"dynamic-e-getmessage-from-sstableacquisitionex","errorCode":null,"errorMessage":"(dynamic) e.getMessage() from SSTableAcquisitionException","messagePattern":"\\(dynamic\\) e\\.getMessage\\(\\) from SSTableAcquisitionException","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/db/repair/PendingAntiCompaction.java","lineNumber":210,"sourceCode":"        private AcquireResult acquireTuple()\n        {\n            // this method runs with compactions stopped & disabled\n            try\n            {\n                // using predicate might throw if there are conflicting ranges\n                Set<SSTableReader> sstables = cfs.getLiveSSTables().stream().filter(predicate).collect(Collectors.toSet());\n                if (sstables.isEmpty())\n                    return new AcquireResult(cfs, null, null);\n\n                LifecycleTransaction txn = cfs.getTracker().tryModify(sstables, OperationType.ANTICOMPACTION);\n                if (txn != null)\n                    return new AcquireResult(cfs, Refs.ref(sstables), txn);\n                else\n                    logger.error(\"Could not mark compacting for {} (sstables = {}, compacting = {})\", sessionID, sstables, cfs.getTracker().getCompacting());\n            }\n            catch (SSTableAcquisitionException e)\n            {\n                logger.warn(e.getMessage());\n                logger.debug(\"Got exception trying to acquire sstables\", e);\n            }\n\n            return null;\n        }\n\n        protected AcquireResult acquireSSTables()\n        {\n            return cfs.runWithCompactionsDisabled(this::acquireTuple, predicate, OperationType.ANTICOMPACTION, false, false, false);\n        }\n\n        public AcquireResult call()\n        {\n            logger.debug(\"acquiring sstables for pending anti compaction on session {}\", sessionID);\n            // try to modify after cancelling running compactions. This will attempt to cancel in flight compactions including the given sstables for\n            // up to a minute, after which point, null will be returned\n            long start = currentTimeMillis();\n            long delay = TimeUnit.SECONDS.toMillis(acquireRetrySeconds);","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/repair/PendingAntiCompaction.java#L192-L228","documentation":"During PendingAntiCompaction's acquireTuple, Cassandra tries to mark candidate sstables compacting for a repair session. If it fails with SSTableAcquisitionException (e.g. sstables already compacting or being acquired elsewhere), the message is logged at WARN while the full stack trace is only at DEBUG, and the acquisition attempt returns null so repair proceeds without those sstables this round.","triggerScenarios":"Running incremental repair (nodetool repair) while concurrent compactions or another repair session already holds the required sstables via the CompactionStrategyManager lifecycle transaction.","commonSituations":"Overlapping repairs on the same table; aggressive concurrent compaction throughput; anticompaction racing with foreground compaction on busy nodes.","solutions":["Check debug.log for the full 'Got exception trying to acquire sstables' stack to see which sstables/compactions collided","Avoid running multiple repairs concurrently; serialize repair sessions","Throttle compaction (nodetool stop compaction temporarily or compaction_throughput) during repair windows","Retry the repair after compactions quiesce; the message itself indicates the node handled it gracefully"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// avoid collisions: check compacting set before repair\nSet<SSTableReader> compacting = cfs.getTracker().getCompacting();\nif (compacting.containsAll(candidates)) logger.warn(\"Candidates busy; defer repair\");","typeGuard":null,"tryCatchPattern":"// caller pattern around PendingAntiCompaction\ntry { result = antiCompactionTask.get(); } catch (SSTableAcquisitionException e) { logger.info(\"Retry later: {}\", e.getMessage()); }","preventionTips":["Serialize repair sessions; avoid overlapping repairs","Quiesce compaction during repair windows","Track pending compactions before scheduling repairs","Check debug.log for which sstables collided"],"tags":["repair","compaction","concurrency"],"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-14T16:17:12.679Z"}