{"record":{"id":"681eb184b966230f","repo":"apache/cassandra","slug":"timed-out-waiting-to-acquire-sstables","errorCode":null,"errorMessage":"{} Timed out waiting to acquire sstables","messagePattern":"(.+?) Timed out waiting to acquire sstables","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/db/repair/PendingAntiCompaction.java","lineNumber":251,"sourceCode":"            do\n            {\n                try\n                {\n                    // Note that anticompactions are not disabled when running this. This is safe since runWithCompactionsDisabled\n                    // is synchronized - acquireTuple and predicate can only be run by a single thread (for the given cfs).\n                    return acquireSSTables();\n                }\n                catch (SSTableAcquisitionException e)\n                {\n                    logger.warn(\"Session {} failed acquiring sstables: {}, retrying every {}ms for another {}s\",\n                                sessionID,\n                                e.getMessage(),\n                                acquireSleepMillis,\n                                TimeUnit.SECONDS.convert(delay + start - currentTimeMillis(), TimeUnit.MILLISECONDS));\n                    Uninterruptibles.sleepUninterruptibly(acquireSleepMillis, TimeUnit.MILLISECONDS);\n\n                    if (currentTimeMillis() - start > delay)\n                        logger.warn(\"{} Timed out waiting to acquire sstables\", sessionID, e);\n\n                }\n                catch (Throwable t)\n                {\n                    logger.error(\"Got exception disabling compactions for session {}\", sessionID, t);\n                    throw t;\n                }\n            } while (currentTimeMillis() - start < delay);\n            return null;\n        }\n    }\n\n    static class AcquisitionCallback implements Function<List<AcquireResult>, Future<List<Void>>>\n    {\n        private final TimeUUID parentRepairSession;\n        private final RangesAtEndpoint tokenRanges;\n        private final BooleanSupplier isCancelled;\n","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/repair/PendingAntiCompaction.java#L233-L269","documentation":"PendingAntiCompaction acquires sstables for an incremental repair by disabling compaction and compaction-blocking the relevant readers. When acquisition keeps failing (e.g. a compaction is concurrently writing those sstables), it retries with a backoff until a total 'delay' elapses; when the deadline passes it logs this warning while continuing the retry loop until the caller-level timeout aborts the session.","triggerScenarios":"call() enters its acquisition retry loop, each attempt throws (typically CompactionInterruptedException from disabling compaction while a compaction is active), and currentTimeMillis() - start exceeds the configured delay without all sstables being acquired.","commonSituations":"Multiple incremental repair sessions overlapping on nodes that share token ranges; heavy continuous compaction workload that prevents compaction from being stopped within the delay window; very small repair delays configured (compaction_throughput / concurrent_compactors keeping writers busy).","solutions":["Find and stop the concurrent incremental repair sessions that overlap token ranges (nodetool repair_admin list, cancel duplicates) then re-run the repair","Reduce compaction activity or wait for compactions to drain and retry the repair","Increase the acquisition delay/timeout for repair so sstable acquisition has more time","Stagger repair scheduling across nodes sharing ranges to avoid contention"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// before repair: check no other incremental repairs hold sstables\nProcessHandle lists = // nodetool repair_admin list\n// verify no overlapping sessions and compaction queue is idle:// nodetool compactionstats -- show no active compactions on repaired tables","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never run overlapping incremental repairs on shared token ranges","Schedule repairs during low-compaction windows","Monitor compactionstats before starting repairs","Give the acquisition delay generous headroom for busy nodes"],"tags":["repair","compaction","timeout","concurrency"],"backgroundTag":"repair-sstable-acquisition-timeout","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"}