{"record":{"id":"22498f59e5560e81","repo":"apache/cassandra","slug":"interrupted-while-building-indexes-on-sstable-22498f","errorCode":null,"errorMessage":"Interrupted while building indexes {} on SSTable {}","messagePattern":"Interrupted while building indexes (.+?) on SSTable (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/java/org/apache/cassandra/index/sai/StorageAttachedIndexBuilder.java","lineNumber":210,"sourceCode":"                    bytesProcessed += bytesRead - previousBytesRead;\n                    previousBytesRead = bytesRead;\n                }\n\n                completeSSTable(indexWriter, sstable, indexes, perSSTableFileLock);\n            }\n\n            return false;\n        }\n        catch (Throwable t)\n        {\n            if (indexWriter != null)\n            {\n                indexWriter.abort(t, true);\n            }\n\n            if (t instanceof InterruptedException)\n            {\n                logger.warn(logMessage(\"Interrupted while building indexes {} on SSTable {}\"), indexes, sstable.descriptor);\n                Thread.currentThread().interrupt();\n                return true;\n            }\n            else if (t instanceof CompactionInterruptedException)\n            {\n                //TODO Shouldn't do this if the stop was interrupted by a truncate\n                if (isInitialBuild)\n                {\n                    logger.error(logMessage(\"Stop requested while building initial indexes {} on SSTable {}.\"), indexes, sstable.descriptor);\n                    throw Throwables.unchecked(t);\n                }\n                else\n                {\n                    logger.info(logMessage(\"Stop requested while building indexes {} on SSTable {}.\"), indexes, sstable.descriptor);\n                    return true;\n                }\n            }\n            else","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/index/sai/StorageAttachedIndexBuilder.java#L192-L228","documentation":"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.","triggerScenarios":"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.","commonSituations":"CREATE INDEX back-fill interrupted by restart; dropping a column/index cancels in-flight builds; operational stop of compaction during maintenance.","solutions":["No action needed for intentional interruption — restart the node or re-trigger the build to complete index construction.","If unexpected, audit recent operations on the table (DROP INDEX, TRUNCATE, nodetool stop) that cancel index builds.","Confirm index completeness after interruption: check system_views.system_sstable_indexes / query behavior, or DROP and re-ADD the index for a clean rebuild."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Operator-level: interrupted SAI build is retryable; re-run or rebuild after restart\n// Check pending index builds in system_views.sai_indexes / sstable_indexes views,\n// or DROP/CREATE the index to force a clean rebuild","preventionTips":["Don't issue TRUNCATE/DROP INDEX/nodetool stop while SAI back-fill is in progress.","Run index creation during maintenance windows on large SSTable sets.","Monitor SAI build status (system_views.sai_indexes) before planned restarts.","After interruption, confirm index segments cover all SSTables before trusting index reads."],"tags":["cassandra","sai","secondary-index","interrupt","sstable"],"backgroundTag":"thread-interrupted","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"}