{"record":{"id":"4bef7a65f808c78a","repo":"thanos-io/thanos","slug":"sync-blockdir","errorCode":null,"errorMessage":"sync blockDir","messagePattern":"sync blockDir","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/compact/downsample/streamed_block_writer.go","lineNumber":169,"sourceCode":"\t\t// Close open file descriptors anyway.\n\t\tfor _, cl := range w.closers {\n\t\t\tmerr.Add(cl.Close())\n\t\t}\n\t\treturn merr.Err()\n\t}\n\n\t// Finalize saves prepared index and metadata to corresponding files.\n\n\tfor _, cl := range w.closers {\n\t\tmerr.Add(cl.Close())\n\t}\n\n\tif err := w.writeMetaFile(); err != nil {\n\t\treturn errors.Wrap(err, \"write meta meta\")\n\t}\n\n\tif err := w.syncDir(); err != nil {\n\t\treturn errors.Wrap(err, \"sync blockDir\")\n\t}\n\n\tif err := merr.Err(); err != nil {\n\t\treturn errors.Wrap(err, \"finalize\")\n\t}\n\n\t// No error, claim success.\n\n\tlevel.Info(w.logger).Log(\n\t\t\"msg\", \"finalized downsampled block\",\n\t\t\"mint\", w.meta.MinTime,\n\t\t\"maxt\", w.meta.MaxTime,\n\t\t\"ulid\", w.meta.ULID,\n\t\t\"resolution\", w.meta.Thanos.Downsample.Resolution,\n\t)\n\treturn nil\n}\n","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/compact/downsample/streamed_block_writer.go#L151-L187","documentation":"Wraps w.syncDir in streamedBlockWriter.Close while finalizing a downsampled block: fsync-ing the finished block's directory failed, so the completed files may not be durable. The finalization of the streamed downsample result is reported as failed.","triggerScenarios":"Thrown at pkg/compact/downsample/streamed_block_writer.go:169 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the underlying syncDir error (filesystem support, I/O errors in system logs).","Verify the filesystem supports fdatasync on directories.","Retry the block production; treat the block as incomplete."],"exampleFix":null,"handlingStrategy":"try-catch","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"}