apache/cassandra · error · RuntimeException

Aborted garbage collection for at least one table, check…

Error message

Aborted garbage collection for at least one table, check server logs for more information.

What it means

The public userDefinedGarbageCollect wrapper invokes garbage collection on user-defined (already listed) SSTables via JMX and throws RuntimeException with this message when the operation reports a non-zero (aborted/failed) status for any table.

Solutions

  1. Check server logs for why the user-defined compaction aborted
  2. Regenerate the SSTable list — files may have changed since it was produced
  3. Re-run the command when no other compaction jobs target the same files
Defensive patterns

Strategy: retry

Validate before calling

// Validate datafile list is fresh before invoking
if (datafiles == null || datafiles.isEmpty()) return;

Try / catch

try {
    probe.userDefinedGarbageCollect(out, tombstoneOption, jobs, userDefinedTables);
} catch (RuntimeException e) {
    logger.warn("user-defined garbagecollect aborted; regenerating SSTable list and retrying", e);
    retryWithFreshList();
}

Prevention

When it happens

Trigger: nodetool garbagecollect on user-defined files (NodeProbe.userDefinedGarbageCollect) when the server-side operation returns a non-zero status — the GC compaction was aborted or failed for at least one of the supplied user-defined SSTables.

Common situations: User-defined compaction list referencing SSTables that were compacted away or deleted between listing and execution; concurrent operations holding those SSTables; typo'd or stale datafile paths.

Understand the failure class

Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/0d691f785ea3e39c. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/tools/NodeProbe.java:512

                throw new RuntimeException(String.format("Failed marking some sstables compacting in keyspace %s, check server logs for more information.\n", ks));
        }
    }

    public void garbageCollect(PrintStream out, String tombstoneOption, int jobs, String keyspaceName, String... tableNames) throws IOException, ExecutionException, InterruptedException
    {
        if (garbageCollect(tombstoneOption, jobs, keyspaceName, tableNames) != 0)
        {
            out.println("Aborted garbage collection for at least one table in keyspace " + keyspaceName + ", check server logs for more information.");
            throw new RuntimeException("Aborted garbage collection for at least one table in keyspace " + keyspaceName + ", check server logs for more information.");
        }
    }

    public void userDefinedGarbageCollect(PrintStream out, String tombstoneOption, int jobs, List<String> userDefinedTables) throws IOException, ExecutionException, InterruptedException
    {
        if (userDefinedGarbageCollect(tombstoneOption, jobs, userDefinedTables) != 0)
        {
            out.println("Aborted garbage collection for at least one table, check server logs for more information.");
            throw new RuntimeException("Aborted garbage collection for at least one table, check server logs for more information.");
        }
    }

    public void forceUserDefinedCompaction(String datafiles) throws IOException, ExecutionException, InterruptedException
    {
        compactionProxy.forceUserDefinedCompaction(datafiles);
    }

    public void forceKeyspaceCompaction(boolean splitOutput, int parallelism, String keyspaceName, String... tableNames) throws IOException, ExecutionException, InterruptedException
    {
        ssProxy.forceKeyspaceCompaction(splitOutput, parallelism, keyspaceName, tableNames);
    }

    public void forceKeyspaceCompaction(boolean splitOutput, String keyspaceName, String... tableNames) throws IOException, ExecutionException, InterruptedException
    {
        ssProxy.forceKeyspaceCompaction(splitOutput, keyspaceName, tableNames);
    }

View on GitHub (pinned to 88fd0f6a0e)