{"record":{"id":"bdf5ea9ff5acd0f9","repo":"apache/cassandra","slug":"error-occurred-during-enabling-auto-compaction-bdf5ea","errorCode":null,"errorMessage":"Error occurred during enabling auto-compaction","messagePattern":"Error occurred during enabling auto-compaction","errorType":"exception","errorClass":"java.lang.RuntimeException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/nodetool/UpgradeSSTable.java","lineNumber":91,"sourceCode":"        {\n            for (int retries = 0; retries < 5; retries++)\n            {\n                try\n                {\n                    if (retries > 0)\n                        Thread.sleep(500);\n                    probe.upgradeSSTables(probe.output().out, keyspace, !includeAll, maxSSTableTimestamp, jobs, tableNames);\n                    break;\n                }\n                catch (RuntimeException cie)\n                {\n                    // Spin retry. See CASSANDRA-18635\n                    if (ExceptionUtils.indexOfThrowable(cie, CompactionInterruptedException.class) != -1 && retries == 4)\n                        throw (cie);\n                }\n                catch (Exception e)\n                {\n                    throw new RuntimeException(\"Error occurred during enabling auto-compaction\", e);\n                }\n            }\n        }\n    }\n}\n","sourceCodeStart":73,"sourceCodeEnd":97,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/UpgradeSSTable.java#L73-L97","documentation":"UpgradeSSTable (nodetool upgradesstables / --include-all-sstables flow) re-enables auto-compaction for the selected tables after the upgrade pass. If any exception escapes that re-enable step (after the bounded CASSANDRA-18635 retry spin), it is wrapped in a RuntimeException with this message and the original cause attached. The upgrade itself may have partially completed; the failure is in restoring auto-compaction.","triggerScenarios":"Exception thrown by compactionManager.enableAutoCompaction for a table (e.g. JMX/remote error, table dropped mid-operation, interrupted compaction exhausting 4 retries).","commonSituations":"Running upgradesstables during a schema change/drop; node under heavy load with concurrent operations; intermittent JMX connection problems; CASSANDRA-18635 interrupted-compaction retries exhausted.","solutions":["Inspect the wrapped cause ('Caused by') to find the root failure.","Re-run `nodetool enableautocompaction <ks> <table>` manually to restore compaction.","Verify with `nodetool getcompactionthroughput`/status that the table is not left in a bad state, then re-run upgradesstables.","Retry during lower load; ensure the table was not dropped concurrently."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// before running, ensure no concurrent schema changes and compaction state is queryable\nrunNodetool(\"compactionstats\"); // confirms JMX and compaction manager are responsive","typeGuard":null,"tryCatchPattern":"try { runNodetool(\"upgradesstables\"); }\ncatch (RuntimeException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"Error occurred during enabling auto-compaction\")) {\n    runNodetool(\"enableautocompaction\", keyspace, table); // restore state, log root cause e.getCause()\n  } else throw e;\n}","preventionTips":["Avoid running upgradesstables concurrently with DDL (drop/alter) operations.","Always re-enable auto-compaction manually if the command fails.","Schedule upgradesstables during low-load windows to avoid interrupted-compaction retries.","Monitor system.log for CompactionInterruptedException before/after upgrades."],"tags":["nodetool","compaction","runtime"],"backgroundTag":"operation-interrupted","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}