{"record":{"id":"d1e1348b93f719d7","repo":"thanos-io/thanos","slug":"mark-block-s-for-deletion-from-bucket","errorCode":null,"errorMessage":"mark block %s for deletion from bucket","messagePattern":"mark block (.+?) for deletion from bucket","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/compact/compact.go","lineNumber":1396,"sourceCode":"\t}\n\n\tlevel.Info(cg.logger).Log(\"msg\", \"finished compacting blocks\", \"duration\", time.Since(groupCompactionBegin),\n\t\t\"duration_ms\", time.Since(groupCompactionBegin).Milliseconds(), \"result_blocks\", compIDStrs, \"source_blocks\", sourceBlockStr)\n\treturn true, compIDs, nil\n}\n\nfunc (cg *Group) deleteBlock(id ulid.ULID, bdir string, blockDeletableChecker BlockDeletableChecker) error {\n\tif err := os.RemoveAll(bdir); err != nil {\n\t\treturn errors.Wrapf(err, \"remove old block dir %s\", id)\n\t}\n\n\tif blockDeletableChecker.CanDelete(cg, id) {\n\t\t// Spawn a new context so we always mark a block for deletion in full on shutdown.\n\t\tdelCtx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)\n\t\tdefer cancel()\n\t\tlevel.Info(cg.logger).Log(\"msg\", \"marking compacted block for deletion\", \"old_block\", id)\n\t\tif err := block.MarkForDeletion(delCtx, cg.logger, cg.bkt, id, \"source of compacted block\", cg.blocksMarkedForDeletion); err != nil {\n\t\t\treturn errors.Wrapf(err, \"mark block %s for deletion from bucket\", id)\n\t\t}\n\t}\n\treturn nil\n}\n\n// BucketCompactor compacts blocks in a bucket.\ntype BucketCompactor struct {\n\tlogger                         log.Logger\n\tsy                             *Syncer\n\tgrouper                        Grouper\n\tcomp                           Compactor\n\tplanner                        Planner\n\tblockDeletableChecker          BlockDeletableChecker\n\tcompactionLifecycleCallback    CompactionLifecycleCallback\n\tcompactDir                     string\n\tbkt                            objstore.Bucket\n\tconcurrency                    int\n\tskipBlocksWithOutOfOrderChunks bool","sourceCodeStart":1378,"sourceCodeEnd":1414,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/compact/compact.go#L1378-L1414","documentation":"A constructor validation guard in NewBucketCompactor: the concurrency argument (from the compactor's --compact.concurrency flag or programmatic callers) is <= 0, which would spin up no worker or panic on semaphore creation. Pure argument-validation failure with no I/O involved.","triggerScenarios":"Thrown at pkg/compact/compact.go:1396 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check local disk permissions and open file handles","Verify bucket permissions for deletion marks","Retry after the wrapped cause is fixed"],"exampleFix":null,"handlingStrategy":"retry","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"}