{"record":{"id":"6eae7c9c007a4542","repo":"apache/cassandra","slug":"aborted-garbage-collection-for-at-least-one-table","errorCode":null,"errorMessage":"Aborted garbage collection for at least one table in keyspace ${keyspaceName}, check server logs for more information.","messagePattern":"Aborted garbage collection for at least one table in keyspace (.+?), check server logs for more information\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/NodeProbe.java","lineNumber":503,"sourceCode":"    {\n        switch (job.perform())\n        {\n            case 1:\n                out.printf(\"Aborted %s for at least one table in keyspace %s, check server logs for more information.\\n\",\n                           jobName, ks);\n                break;\n            case 2:\n                out.printf(\"Failed marking some sstables compacting in keyspace %s, check server logs for more information.\\n\", ks);\n                throw new RuntimeException(String.format(\"Failed marking some sstables compacting in keyspace %s, check server logs for more information.\\n\", ks));\n        }\n    }\n\n    public void garbageCollect(PrintStream out, String tombstoneOption, int jobs, String keyspaceName, String... tableNames) throws IOException, ExecutionException, InterruptedException\n    {\n        if (garbageCollect(tombstoneOption, jobs, keyspaceName, tableNames) != 0)\n        {\n            out.println(\"Aborted garbage collection for at least one table in keyspace \" + keyspaceName + \", check server logs for more information.\");\n            throw new RuntimeException(\"Aborted garbage collection for at least one table in keyspace \" + keyspaceName + \", check server logs for more information.\");\n        }\n    }\n\n    public void userDefinedGarbageCollect(PrintStream out, String tombstoneOption, int jobs, List<String> userDefinedTables) throws IOException, ExecutionException, InterruptedException\n    {\n        if (userDefinedGarbageCollect(tombstoneOption, jobs, userDefinedTables) != 0)\n        {\n            out.println(\"Aborted garbage collection for at least one table, check server logs for more information.\");\n            throw new RuntimeException(\"Aborted garbage collection for at least one table, check server logs for more information.\");\n        }\n    }\n\n    public void forceUserDefinedCompaction(String datafiles) throws IOException, ExecutionException, InterruptedException\n    {\n        compactionProxy.forceUserDefinedCompaction(datafiles);\n    }\n\n    public void forceKeyspaceCompaction(boolean splitOutput, int parallelism, String keyspaceName, String... tableNames) throws IOException, ExecutionException, InterruptedException","sourceCodeStart":485,"sourceCodeEnd":521,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/NodeProbe.java#L485-L521","documentation":"The public garbageCollect wrapper calls the JMX gc operation and checks the returned status code; a non-zero result means the garbage-collection (compaction) job aborted for at least one table. It prints a message and throws RuntimeException so nodetool exits with an error.","triggerScenarios":"nodetool garbagecollect (or NodeProbe.garbageCollect) when the server-side CompactionManagerMBean.garbageCollect returns a non-zero status for at least one table in the given keyspace — typically the tombstone compaction task aborted or failed to mark SSTables.","commonSituations":"Concurrent compaction activity on the target tables; interrupted JMX task execution; a table in the keyspace unavailable mid-operation (e.g. being dropped or repaired).","solutions":["Check the server logs on the node for the underlying compaction abort reason","Re-run garbagecollect after concurrent compactions have settled","Retry per-keyspace/table to isolate which table failed","Consider running with lower parallelism or during lower load"],"exampleFix":"// before\nnodetool garbagecollect keyspace1\n// after (retry per table to isolate failures)\nnodetool garbagecollect keyspace1 table1","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    probe.garbageCollect(out, tombstoneOption, jobs, ks, tableNames);\n} catch (RuntimeException e) {\n    logger.warn(\"garbagecollect aborted for {} — check server logs, retrying\", ks, e);\n    probe.garbageCollect(out, tombstoneOption, jobs, ks, tableNames);\n}","preventionTips":["Avoid running garbagecollect concurrently with repairs or other compactions","Retry per-table to isolate and localize failures","Always check node server logs for the root cause"],"tags":["compaction","garbagecollect","jmx"],"backgroundTag":"database-query-failed","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"}