{"record":{"id":"004fca837f41d96e","repo":"thanos-io/thanos","slug":"unexpected-deletion-mark-file-version-d-expected","errorCode":null,"errorMessage":"unexpected deletion-mark file version %d, expected %d","messagePattern":"unexpected deletion-mark file version (.+?), expected (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/block/metadata/markers.go","lineNumber":149,"sourceCode":"\tif err != nil {\n\t\treturn errors.Wrapf(err, \"read file: %s\", markerFile)\n\t}\n\n\tif err := json.Unmarshal(metaContent, marker); err != nil {\n\t\treturn errors.Wrapf(ErrorUnmarshalMarker, \"file: %s; err: %v\", markerFile, err.Error())\n\t}\n\tswitch marker.markerFilename() {\n\tcase NoCompactMarkFilename:\n\t\tif version := marker.(*NoCompactMark).Version; version != NoCompactMarkVersion1 {\n\t\t\treturn errors.Errorf(\"unexpected no-compact-mark file version %d, expected %d\", version, NoCompactMarkVersion1)\n\t\t}\n\tcase NoDownsampleMarkFilename:\n\t\tif version := marker.(*NoDownsampleMark).Version; version != NoDownsampleMarkVersion1 {\n\t\t\treturn errors.Errorf(\"unexpected no-downsample-mark file version %d, expected %d\", version, NoDownsampleMarkVersion1)\n\t\t}\n\tcase DeletionMarkFilename:\n\t\tif version := marker.(*DeletionMark).Version; version != DeletionMarkVersion1 {\n\t\t\treturn errors.Errorf(\"unexpected deletion-mark file version %d, expected %d\", version, DeletionMarkVersion1)\n\t\t}\n\t}\n\treturn nil\n}\n","sourceCodeStart":131,"sourceCodeEnd":154,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/block/metadata/markers.go#L131-L154","documentation":"ReadMarker verifies that a deletion-mark file's Version field equals DeletionMarkVersion1. This error is raised when the deletion marker JSON parses but its version is not the supported version 1, indicating the marker was written by an incompatible format. Because deletion marks gate whether a block's data can be removed, M3DB refuses to trust a marker with an unknown version.","triggerScenarios":"Calling ReadMarker on a deletion-mark file whose decoded Version differs from DeletionMarkVersion1 — e.g. a deletion mark written by a newer M3DB release, or a file whose version field was edited or corrupted after a crash.","commonSituations":"Rolling upgrade with mixed node versions; restoring an old snapshot under a newer binary (or vice versa); operator manually editing deletion markers to force block deletion; partial disk writes corrupting the version field.","solutions":["Inspect the Version field in the deletion-mark file and determine which M3DB version wrote it.","Run a binary that supports that marker version (upgrade/downgrade the node accordingly).","If the deletion was already applied or is safe to re-issue, delete the malformed deletion-mark and re-run the block deletion via the supported API.","Never hand-edit deletion markers; use the m3ctl/deletion tooling so version fields are set correctly."],"exampleFix":"// before: hand-edited deletion-mark {\"Version\": 99, ...} -> error\n\n// after: re-issue deletion through the supported path\nclient.DeleteBlocks(namespace, blockIDs) // writes DeletionMark{Version: DeletionMarkVersion1}","handlingStrategy":"try-catch","validationCode":"var m struct{ Version int `json:\"version\"` }\nif json.Unmarshal(data, &m) == nil && m.Version != metadata.DeletionMarkVersion1 {\n    // do not trust this deletion mark\n}","typeGuard":"func isKnownDeletionMarkVersion(v int) bool { return v == metadata.DeletionMarkVersion1 }","tryCatchPattern":"if err := metadata.ReadMarker(path, marker); err != nil {\n    if strings.Contains(err.Error(), \"unexpected deletion-mark file version\") {\n        // refuse deletion flow; re-issue deletion via supported API\n        return fmt.Errorf(\"deletion-mark version skew: %w\", err)\n    }\n    return err\n}","preventionTips":["Issue block deletions only through the m3ctl/API path, never by writing marker files manually.","Verify cluster node versions match before and after deletion operations.","Do not restore old snapshots under a much newer binary without checking marker versions.","Treat any hand-modified deletion mark as invalid and re-create it via the supported flow."],"tags":["versioning","metadata","deletion","compatibility"],"backgroundTag":"invalid-enum-value","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"}