{"record":{"id":"08f0cf31dd771728","repo":"apache/cassandra","slug":"failed-to-update-per-column-components-for-sstable","errorCode":null,"errorMessage":"Failed to update per-column components for SSTable {}","messagePattern":"Failed to update per-column components for SSTable (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/index/sai/view/IndexViewManager.java","lineNumber":206,"sourceCode":"                    logger.debug(index.identifier().logMessage(\"No on-disk index was built for SSTable {} because the SSTable \" +\n                                                               \"had no indexable rows for the index.\"), sstableContext.descriptor());\n                }\n                else\n                {\n                    logger.debug(index.identifier().logMessage(\"Successfully created index for SSTable {}.\"), sstableContext.descriptor());\n                }\n\n                // Try to add new index to the set, if set already has such index, we'll simply release and move on.\n                // This covers situation when SSTable collection has the same SSTable multiple\n                // times because we don't know what kind of collection it actually is.\n                if (!valid.add(ssTableIndex))\n                {\n                    ssTableIndex.release();\n                }\n            }\n            catch (Throwable e)\n            {\n                logger.warn(index.identifier().logMessage(\"Failed to update per-column components for SSTable {}\"), sstableContext.descriptor(), e);\n                invalid.add(sstableContext);\n            }\n        }\n\n        return Pair.create(valid, invalid);\n    }\n}\n","sourceCodeStart":188,"sourceCodeEnd":214,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/index/sai/view/IndexViewManager.java#L188-L214","documentation":"During SAI index view updates, this warning is logged when updating per-column index components for an SSTable throws a Throwable. The SSTable's sstableContext is added to the invalid list so the index view treats its index files as unusable (they will be released/ignored) rather than failing the whole index or query. Callers (IndexViewManager.getBuiltinIndexes / indexes) will see this SSTable excluded from the set of valid indexed SSTables, which can degrade query completeness for data in that SSTable.","triggerScenarios":"Calling getBuiltIndexes (via IndexViewManager.indexes) during index initialization or SSTable addition when opening the SSTable's SAI index files fails - e.g. missing index component files, corrupted descriptors, or IO errors reading per-column components.","commonSituations":"An SSTable was moved/restored into the data directory without its SAI index components; partial writes from a crash left inconsistent index files; disk errors during component open; an upgrade changed the on-disk index format.","solutions":["Run nodetool repair and/or scrubs, or DROP and re-CREATE the SAI index to rebuild the index components for the affected table","Check the node's disk/filesystem health and replace failing hardware if IO errors appear in the logs","Restore the SSTable set from a consistent snapshot (data files plus their index components) or remove the orphaned SSTable so it is compacted away"],"exampleFix":"// before: restoring only data files into the data dir\ncp data.tar/keyspace/table-*-Data.db /var/lib/cassandra/data/keyspace/table/\n// after: restore the full SSTable set (data + index components) then rebuild the index\ncp -a data.tar/keyspace/table/* /var/lib/cassandra/data/keyspace/table/ && cqlsh -e \"DROP INDEX ks.idx; CREATE INDEX ...\"","handlingStrategy":"try-catch","validationCode":"// before building the index view, check the SSTable's SAI components exist\nfor (String component : expectedPerColumnComponents)\n{\n    if (!new File(sstableDir, baseName + component).exists())\n        logger.warn(\"Missing SAI component {} on {}\", component, sstable); // SSTable will be treated invalid\n}","typeGuard":null,"tryCatchPattern":"try { updatePerColumnComponents(sstableContext); }\ncatch (Throwable e)\n{\n    logger.warn(\"SSTable {} has unusable index components - excluding from valid set\", sstableContext.descriptor(), e);\n    invalid.add(sstableContext); // matches library behavior: degrade, don't crash\n}","preventionTips":["Always restore SSTable sets (data + index components) together, never data files alone","Rebuild SAI indexes after crashes that occurred mid-flush/compaction","Run nodetool verify after restoring or moving SSTables between nodes","Monitor logs for repeated invalid-SSTable warnings, which mean queries may silently miss data"],"tags":["sai","index","sstable","io"],"backgroundTag":"file-read-failed","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}