apache/cassandra · info

Interrupted while building indexes

Error message

Interrupted while building indexes {} on SSTable {}

What it means

StorageAttachedIndexBuilder builds SAI indexes per SSTable during compaction or initial index creation. On InterruptedException while indexing an SSTable it logs this warning (through the SAI log message wrapper), restores the thread's interrupt flag, and returns true to signal the build was cleanly cancelled. The index remains queryable for already-built segments and can be rebuilt later.

Solutions

  1. No action needed for intentional interruption — restart the node or re-trigger the build to complete index construction.
  2. If unexpected, audit recent operations on the table (DROP INDEX, TRUNCATE, nodetool stop) that cancel index builds.
  3. Confirm index completeness after interruption: check system_views.system_sstable_indexes / query behavior, or DROP and re-ADD the index for a clean rebuild.
Defensive patterns

Strategy: retry

Try / catch

// Operator-level: interrupted SAI build is retryable; re-run or rebuild after restart
// Check pending index builds in system_views.sai_indexes / sstable_indexes views,
// or DROP/CREATE the index to force a clean rebuild

Prevention

When it happens

Trigger: Interruption during indexSSTable: node shutdown, index cancellation on truncate/drop, compaction stop, or manual build cancellation while a new SAI index back-fills existing SSTables.

Common situations: CREATE INDEX back-fill interrupted by restart; dropping a column/index cancels in-flight builds; operational stop of compaction during maintenance.

Related errors


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

Appendix: source

Thrown at src/java/org/apache/cassandra/index/sai/StorageAttachedIndexBuilder.java:210

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

                completeSSTable(indexWriter, sstable, indexes, perSSTableFileLock);
            }

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

            if (t instanceof InterruptedException)
            {
                logger.warn(logMessage("Interrupted while building indexes {} on SSTable {}"), indexes, 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(logMessage("Stop requested while building initial indexes {} on SSTable {}."), indexes, sstable.descriptor);
                    throw Throwables.unchecked(t);
                }
                else
                {
                    logger.info(logMessage("Stop requested while building indexes {} on SSTable {}."), indexes, sstable.descriptor);
                    return true;
                }
            }
            else

View on GitHub (pinned to 88fd0f6a0e)