apache/cassandra · info

Interrupted while building indexes on SSTable

Error message

Interrupted while building indexes on SSTable {}

What it means

During compaction-driven secondary index building on Accord/transactional data (RouteSecondaryIndexBuilder), if index building on an SSTable is aborted with an InterruptedException, the builder logs this warning, restores the interrupt flag, and reports the SSTable as handled so the build can stop cleanly. Indexes are rebuilt later from remaining SSTables.

Solutions

  1. No action needed if the interruption was intentional (shutdown/stop) — the index build resumes/restarts on next startup or repair.
  2. If unexpected, check what issued the interrupt: recent nodetool operations (stop, drain), truncate, or table drop on the indexed table.
  3. After a cancelled build, verify index health via nodetool tablestats / SSTable-backed index query validation, or rebuild the index explicitly (ALTER TABLE ... DROP/ADD index).
Defensive patterns

Strategy: retry

Try / catch

// Operator-level: treat interrupted index build as retryable
// verify index is queryable / complete after restart, else rebuild:
// ALTER TABLE ks.tbl DROP INDEX idx; CREATE CUSTOM INDEX idx ON ks.tbl (col) USING 'StorageAttachedIndex';

Prevention

When it happens

Trigger: Index build interrupted while iterating an SSTable: nodetool stop with cancellation, node shutdown, compaction stop, or truncate/drop aborting the index writer mid-build.

Common situations: Administrator cancels an index build or stops compaction; node shutdown while a new index was being back-filled over existing SSTables.

Related errors


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

Appendix: source

Thrown at src/java/org/apache/cassandra/index/accord/RouteSecondaryIndexBuilder.java:185

                    bytesProcessed += bytesRead - previousBytesRead;
                    previousBytesRead = bytesRead;
                }

                completeSSTable(indexDescriptor, indexWriter, sstable);
            }

            return false;
        }
        catch (Throwable t)
        {
            if (indexWriter != null)
            {
                indexWriter.abort(t, true);
            }

            if (t instanceof InterruptedException)
            {
                logger.warn("Interrupted while building indexes on SSTable {}", sstable.descriptor);
                Thread.currentThread().interrupt();
                return true;
            }
            else if (t instanceof CompactionInterruptedException)
            {
                //TODO Shouldn't do this if the stop was interrupted by a truncate
                if (isInitialBuild)
                {
                    logger.error("Stop requested while building initial indexes on SSTable {}.", sstable.descriptor);
                    throw Throwables.unchecked(t);
                }
                else
                {
                    logger.info("Stop requested while building indexes on SSTable {}.", sstable.descriptor);
                    return true;
                }
            }
            else

View on GitHub (pinned to 88fd0f6a0e)