{"record":{"id":"7e56124a1b16cd60","repo":"apache/cassandra","slug":"rebuilding-index-summary-because-the-effective-ind","errorCode":null,"errorMessage":"Rebuilding index summary because the effective index interval (%d) is higher than the current max index interval (%d)","messagePattern":"Rebuilding index summary because the effective index interval \\((.+?)\\) is higher than the current max index interval \\((.+?)\\)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/io/sstable/indexsummary/IndexSummary.java","lineNumber":443,"sourceCode":"\n        public <T extends InputStream & DataInputPlus> IndexSummary deserialize(T in, IPartitioner partitioner, int expectedMinIndexInterval, int maxIndexInterval) throws IOException\n        {\n            int minIndexInterval = in.readInt();\n            if (minIndexInterval != expectedMinIndexInterval)\n            {\n                throw new IOException(String.format(\"Cannot read index summary because min_index_interval changed from %d to %d.\",\n                                                    minIndexInterval, expectedMinIndexInterval));\n            }\n\n            int offsetCount = in.readInt();\n            long offheapSize = in.readLong();\n            int samplingLevel = in.readInt();\n            int fullSamplingSummarySize = in.readInt();\n\n            int effectiveIndexInterval = (int) Math.ceil((BASE_SAMPLING_LEVEL / (double) samplingLevel) * minIndexInterval);\n            if (effectiveIndexInterval > maxIndexInterval)\n            {\n                throw new IOException(String.format(\"Rebuilding index summary because the effective index interval (%d) is higher than\" +\n                                                    \" the current max index interval (%d)\", effectiveIndexInterval, maxIndexInterval));\n            }\n\n            Memory offsets = Memory.allocate(offsetCount * 4);\n            Memory entries = Memory.allocate(offheapSize - offsets.size());\n            try\n            {\n                FBUtilities.copy(in, new MemoryOutputStream(offsets), offsets.size());\n                FBUtilities.copy(in, new MemoryOutputStream(entries), entries.size());\n            }\n            catch (IOException ioe)\n            {\n                offsets.free();\n                entries.free();\n                throw ioe;\n            }\n\n            // Before 5.0 offsets were written using Native Endian, now they are stored as Little Endian,","sourceCodeStart":425,"sourceCodeEnd":461,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/io/sstable/indexsummary/IndexSummary.java#L425-L461","documentation":"Thrown by IndexSummary.deserialize when the summary's sampling level implies an effective index interval greater than the table's configured max_index_interval. Cassandra cannot load such a summary and instead rebuilds the index summary for the sstable.","triggerScenarios":"Loading a summary whose sampling level (from index sampling during compaction/downsampling) yields effectiveInterval = ceil(BASE_SAMPLING_LEVEL/samplingLevel * minIndexInterval) > max_index_interval, typically after lowering max_index_interval in the schema while old sstables exist.","commonSituations":"Schema change of max_index_interval without rebuilding summaries, restored sstables from a table with different index settings, version/upgrade mismatches.","solutions":["Raise max_index_interval back to a value >= the effective interval in the table schema","Rebuild the index summaries (the exception triggers automatic rebuild, but forcing `nodetool upgradesstables -a ks t` refreshes everything)","Keep min/max_index_interval consistent when restoring sstables between environments"],"exampleFix":"// before\nALTER TABLE ks.t WITH max_index_interval = 256;\n// after: accommodate existing summaries\nALTER TABLE ks.t WITH max_index_interval = 2048;","handlingStrategy":"fallback","validationCode":"int eff = (int) Math.ceil((BASE_SAMPLING_LEVEL / (double) samplingLevel) * minIndexInterval); if (eff > maxIndexInterval) planSummaryRebuild();","typeGuard":null,"tryCatchPattern":"try { summary.deserialize(in, partitioner, minInterval, maxInterval); } catch (IOException e) { rebuildIndexSummary(descriptor); }","preventionTips":["Only lower max_index_interval after rebuilding summaries","Verify index settings before restoring sstables","Let the automatic summary-rebuild path handle this rather than patching files"],"tags":["io","sstable","index-summary","config"],"backgroundTag":"invalid-config-value","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"}