{"record":{"id":"9aa294138854f365","repo":"thanos-io/thanos","slug":"non-sequential-chunks-not-equal-d-d-and-d","errorCode":null,"errorMessage":"non-sequential chunks not equal: [%d, %d] and [%d, %d]","messagePattern":"non-sequential chunks not equal: \\[(.+?), (.+?)\\] and \\[(.+?), (.+?)\\]","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/block/index.go","lineNumber":516,"sourceCode":"\t\t// \"Near\" outsider from issue https://github.com/prometheus/tsdb/issues/347. Ignore.\n\t\treturn true, nil\n\t}\n\treturn false, nil\n}\n\nfunc IgnoreDuplicateOutsideChunk(_, _ int64, last, curr *chunks.Meta) (bool, error) {\n\tif last == nil {\n\t\treturn false, nil\n\t}\n\n\tif curr.MinTime > last.MaxTime {\n\t\treturn false, nil\n\t}\n\n\t// Verify that the overlapping chunks are exact copies so we can safely discard\n\t// the current one.\n\tif curr.MinTime != last.MinTime || curr.MaxTime != last.MaxTime {\n\t\treturn false, errors.Errorf(\"non-sequential chunks not equal: [%d, %d] and [%d, %d]\",\n\t\t\tlast.MinTime, last.MaxTime, curr.MinTime, curr.MaxTime)\n\t}\n\tca := crc32.Checksum(last.Chunk.Bytes(), castagnoli)\n\tcb := crc32.Checksum(curr.Chunk.Bytes(), castagnoli)\n\n\tif ca != cb {\n\t\treturn false, errors.Errorf(\"non-sequential chunks not equal: %x and %x\", ca, cb)\n\t}\n\n\treturn true, nil\n}\n\n// sanitizeChunkSequence ensures order of the input chunks and drops any duplicates.\n// It errors if the sequence contains non-dedupable overlaps.\nfunc sanitizeChunkSequence(chks []chunks.Meta, mint, maxt int64, ignoreChkFns []ignoreFnType) ([]chunks.Meta, error) {\n\tif len(chks) == 0 {\n\t\treturn nil, nil\n\t}","sourceCodeStart":498,"sourceCodeEnd":534,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/block/index.go#L498-L534","documentation":"IgnoreDuplicateOutsideChunk guard: overlapping chunks have different min/max time ranges, so they cannot be proven duplicates and it is unsafe to drop one. Inputs at fault: corrupt/duplicated blocks with non-identical overlapping chunks.","triggerScenarios":"Thrown at pkg/block/index.go:516 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Investigate the source of duplicated but differing chunks","Use vertical compaction instead of dedup repair","Do not force-drop; data would be lost"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"35b8b991177def87ed52dcf10f9b6d87f07282c8","analyzedAt":"2026-09-07T01:49:59.689Z","contentChangedAt":"2026-09-07T01:49:59.689Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}