{"record":{"id":"fe6c02071bef97c0","repo":"apache/cassandra","slug":"cannot-read-index-summary-because-min-index-interv","errorCode":null,"errorMessage":"Cannot read index summary because min_index_interval changed from %d to %d.","messagePattern":"Cannot read index summary because min_index_interval changed from (.+?) to (.+?)\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/io/sstable/indexsummary/IndexSummary.java","lineNumber":431,"sourceCode":"            // In this case adding X to each of the offsets.\n            int baseOffset = t.offsetCount * 4;\n            for (int i = 0 ; i < t.offsetCount ; i++)\n            {\n                int offset = t.offsets.getInt(i * 4) + baseOffset;\n                // our serialization format for this file uses native byte order, so if this is different to the\n                // default Java serialization order (BIG_ENDIAN) we have to reverse our bytes\n                offset = Integer.reverseBytes(offset);\n                out.writeInt(offset);\n            }\n            out.write(t.entries, 0, t.entriesLength);\n        }\n\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","sourceCodeStart":413,"sourceCodeEnd":449,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/io/sstable/indexsummary/IndexSummary.java#L413-L449","documentation":"Thrown by IndexSummary.deserialize when the min_index_interval stored in the summary file differs from the table's currently configured min_index_interval. The index summary format is tied to the interval, so Cassandra aborts loading and rebuilds/validates rather than producing wrong index entries.","triggerScenarios":"Loading an sstable whose summary was written with a different min_index_interval than the table's current value (e.g. min_index_interval was changed in the table schema, or restored sstables from a cluster with different settings).","commonSituations":"Altering a table's min_index_interval while old sstables exist, restoring sstables from a backup of a differently configured table, copying sstables between clusters with mismatched schemas.","solutions":["Run `nodetool clearsnapshot`-style removal of stale summaries or run upgradesstables -a to rebuild summaries with the current interval","Revert the min_index_interval change in the table schema to match the sstables","Use `nodetool relocatesstables`/offheap_object cleanup or delete the Summary.db component so it regenerates on startup","Move sstables only between tables with identical compaction/index settings"],"exampleFix":"// before: interval changed under existing sstables\nALTER TABLE ks.t WITH min_index_interval = 256;\n// after: rebuild summaries first\nnodetool upgradesstables ks t --include-all-sstables; then ALTER TABLE ks.t WITH min_index_interval = 256;","handlingStrategy":"fallback","validationCode":"// read min_index_interval from summary header before full load; if it differs, plan a rebuild\nint stored = headerStream.readInt(); if (stored != schema.params.minIndexInterval) triggerSummaryRebuild(descriptor);","typeGuard":null,"tryCatchPattern":"try { summary.deserialize(in, partitioner, minInterval, maxInterval); } catch (IOException e) { rebuildIndexSummary(descriptor); }","preventionTips":["Run upgradesstables after changing min_index_interval","Keep identical table settings across clusters you copy sstables between","Document schema changes that invalidate summaries"],"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"}