{"record":{"id":"26ec5b53af7b813a","repo":"apache/cassandra","slug":"failed-to-save-index-summary-to","errorCode":null,"errorMessage":"Failed to save index summary to ","messagePattern":"Failed to save index summary to ","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/io/sstable/format/big/IndexSummaryComponent.java","lineNumber":133,"sourceCode":"    /**\n     * Save index summary to Summary.db file.\n     */\n    public void save(File summaryFile, boolean deleteOnFailure) throws IOException\n    {\n        if (summaryFile.exists())\n            summaryFile.delete();\n\n        try (DataOutputStreamPlus oStream = summaryFile.newOutputStream(File.WriteMode.OVERWRITE))\n        {\n            IndexSummary.serializer.serialize(indexSummary, oStream);\n            ByteBufferUtil.writeWithLength(first.getKey(), oStream);\n            ByteBufferUtil.writeWithLength(last.getKey(), oStream);\n        }\n        catch (IOException ex)\n        {\n            if (deleteOnFailure)\n                summaryFile.deleteIfExists();\n            throw new IOException(\"Failed to save index summary to \" + summaryFile, ex);\n        }\n    }\n}\n","sourceCodeStart":115,"sourceCodeEnd":137,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/io/sstable/format/big/IndexSummaryComponent.java#L115-L137","documentation":"Thrown when writing an index summary to Summary.db fails with an IOException; if deleteOnFailure was set the partial file is removed first. This indicates the SSTable could not persist its summary, preventing it from being opened.","triggerScenarios":"Opening an SSTable that requires building/saving its index summary (e.g. summary rebuild on open via openComponents) and the write fails — disk full, permission denied, or I/O error on the SSTable directory.","commonSituations":"Disk full on the data volume; read-only or wrong-ownership data directory; filesystem errors; interrupted save.","solutions":["Free disk space on the data directory and retry the operation/restart","Fix directory permissions/ownership so Cassandra can write Summary.db","Check filesystem health; remove leftover partial Summary.db files (already deleted when deleteOnFailure) and reopen"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Pre-flight checks before opening SSTables\nassert dataDir.canWrite() : \"data dir not writable\";\nassert dataDir.getUsableSpace() > minRequiredBytes : \"insufficient disk space\";","typeGuard":null,"tryCatchPattern":"try { sstable = openComponents(...); }\ncatch (IOException e) {\n    logger.error(\"Failed saving index summary to {}: {}\", e.getMessage(), e.getCause());\n    alertDiskOrPermissions();\n}","preventionTips":["Monitor data-volume free space and alert before thresholds","Run Cassandra as a user owning the data directory","Avoid read-only mounts / full disks during operations that build summaries"],"tags":["sstable","summary","io","disk"],"backgroundTag":"file-write-failed","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}