{"record":{"id":"e280684ab3e64b71","repo":"thanos-io/thanos","slug":"sync-before-second-pass-of-downsampling","errorCode":null,"errorMessage":"sync before second pass of downsampling","messagePattern":"sync before second pass of downsampling","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/thanos/compact.go","lineNumber":486,"sourceCode":"\n\t\t\tif err := downsampleBucket(\n\t\t\t\tctx,\n\t\t\t\tlogger,\n\t\t\t\tdownsampleMetrics,\n\t\t\t\tinsBkt,\n\t\t\t\tfilteredMetas,\n\t\t\t\tdownsamplingDir,\n\t\t\t\tconf.downsampleConcurrency,\n\t\t\t\tconf.blockFilesConcurrency,\n\t\t\t\tmetadata.HashFunc(conf.hashFunc),\n\t\t\t\tconf.acceptMalformedIndex,\n\t\t\t); err != nil {\n\t\t\t\treturn errors.Wrap(err, \"first pass of downsampling failed\")\n\t\t\t}\n\n\t\t\tlevel.Info(logger).Log(\"msg\", \"start second pass of downsampling\")\n\t\t\tif err := sy.SyncMetas(ctx); err != nil {\n\t\t\t\treturn errors.Wrap(err, \"sync before second pass of downsampling\")\n\t\t\t}\n\n\t\t\t// Regenerate the filtered list of blocks after the sync,\n\t\t\t// to include the blocks created by the first pass.\n\t\t\tfilteredMetas = sy.Metas()\n\t\t\tnoDownsampleBlocks = noDownsampleMarkerFilter.NoDownsampleMarkedBlocks()\n\t\t\tfor ul := range noDownsampleBlocks {\n\t\t\t\tdelete(filteredMetas, ul)\n\t\t\t}\n\n\t\t\tif err := downsampleBucket(\n\t\t\t\tctx,\n\t\t\t\tlogger,\n\t\t\t\tdownsampleMetrics,\n\t\t\t\tinsBkt,\n\t\t\t\tfilteredMetas,\n\t\t\t\tdownsamplingDir,\n\t\t\t\tconf.downsampleConcurrency,","sourceCodeStart":468,"sourceCodeEnd":504,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/compact.go#L468-L504","documentation":"Wrapper error in runCompact's second downsampling pass (cmd/thanos/compact.go:486) around sy.SyncMetas(ctx). The metadata re-sync after the first downsampling pass failed, preventing discovery of blocks created by the first pass.","triggerScenarios":"sy.SyncMetas(ctx) error during the second pass: same causes as any meta sync — object store listing/reading failures, throttling, network errors, corrupt metadata objects.","commonSituations":"Sustained object store outage or rate limits during long compaction runs; credentials rotated mid-run; large bucket listing timeouts.","solutions":["Inspect the wrapped inner error for the root object-store failure","Retry the run; syncs are idempotent","Check for object-store throttling and add client-side retry/backoff","Verify credentials are still valid for the duration of long runs"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := sy.SyncMetas(ctx); err != nil {\n\tif errors.Is(err, context.Canceled) { return err }\n\treturn errors.Wrap(err, \"sync before second pass of downsampling\")\n}","preventionTips":["Same as pass one: client retries, valid credentials, store health checks","Schedule compaction windows away from other heavy store traffic"],"tags":["thanos","object-storage","sync","downsampling"],"backgroundTag":"http-request-failed","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"}