apache/cassandra · warning

Aborting SSTable index flush for {}...

Error message

Aborting SSTable index flush for {}...

What it means

SSTableIndexWriter.abort is invoked when an SAI SSTable index write is aborted, from indexSSTable (exception during build), maybeAbort (segment writer failure), or writeSegmentsMetadata. Like MemtableIndexWriter.abort, cause == null is the benign no-flush-needed path (DEBUG); a non-null cause is a real failure logged at WARN. The abort releases segment-builder memory tracked by the global limiter and deletes partial on-disk index components.

Source

Thrown at src/java/org/apache/cassandra/index/sai/disk/v1/SSTableIndexWriter.java:187

        finally
        {
            index.indexMetrics().segmentsPerCompaction.update(segments.size());
            segments.clear();
            index.indexMetrics().compactionCount.inc();
        }
    }

    @Override
    public void abort(Throwable cause)
    {
        aborted = true;

        String message = index.identifier().logMessage("Aborting SSTable index flush for {}...");

        if (cause == null)
            logger.debug(message, indexDescriptor.sstableDescriptor);
        else 
            logger.warn(message, indexDescriptor.sstableDescriptor, cause);

        // It's possible for the current builder to be unassigned after we flush a final segment.
        if (currentBuilder != null)
        {
            // If an exception is thrown out of any writer operation prior to successful segment
            // flush, we will end up here, and we need to free up builder memory tracked by the limiter:
            long allocated = currentBuilder.totalBytesAllocated();
            long globalBytesUsed = currentBuilder.release();
            logger.debug(index.identifier().logMessage("Aborting index writer for SSTable {} released {}. Global segment memory usage now at {}."),
                         indexDescriptor.sstableDescriptor, FBUtilities.prettyPrintMemory(allocated), FBUtilities.prettyPrintMemory(globalBytesUsed));
        }

        indexDescriptor.deleteColumnIndex(index.termType(), index.identifier());
    }

    /**
     * abort current write if index is dropped
     *

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Read the attached cause in the WARN log — it names the real failure (usually IOException or OutOfMemoryError).
  2. If memory-related, lower cassandra.yaml `column_index_size_in_kb`/segment size or raise `sai.segment_write_buffer_size` headroom; ensure heap and off-heap limits accommodate concurrent index builds.
  3. Free disk space in the data directory and re-trigger the build (`nodetool scsirebuild` or recreate the index).
  4. If aborts recur on the same SSTable, drop and recreate the index to rebuild from a clean state.

Example fix

// before: default segment write memory, builds OOM under heavy load
# cassandra.yaml
sai_coordinator_resume: true
// after: tune limits and rebuild
# cassandra.yaml
sai: { segment_write_buffer_size: 1024 }
# then: nodetool scsirebuild --index my_index keyspace table
Defensive patterns

Strategy: try-catch

Try / catch

// ensure memory tracked by the limiter is released even on unexpected paths
try { writeSegmentsMetadata(); }
catch (Throwable t) { writer.abort(t); throw t; }

Prevention

When it happens

Trigger: An exception is thrown out of any writer operation before the segment flush succeeds (disk I/O error, out-of-memory in the index write buffer); the flush is cancelled because the final segment was already written; index_sai_segment_write_memory_limit exhaustion causing writer failure.

Common situations: Disk full during index build; write buffer allocation failures under the segment write memory limit; node shutdown mid-build; concurrent SSTable lifecycle changes invalidating the in-progress build.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


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