Skip to content

Conversation

@waltherlee
Copy link
Contributor

A recent change (#8389) in fetcher.go makes the compactor list as partial any block with marks, like no-compact or no-delete, when using a recursive discovery strategy.

In the previous implementation, the compactor used to run the following checks:

for id, _ := range blocks {
    for _, file := range blocks[id] {
        if _, ok := partialBlocks[id]; !ok {
            partialBlocks[id] = true
        }
        if IsBlockMetaFile {
            partialBlocks[id] = false
        }
    }
}

In the current one:

for id, _ := range blocks {
    for _, file := range blocks[id] {
        if _, ok := partialBlocks[id]; !ok {
            partialBlocks[id] = true
        }
        if IsBlockMetaFile {
           delete(partialBlocks, id)
        }
    }
}

If the bucket iterator returns any file after meta.json, like no-compact-mark.json, partialBlocks[id] will be empty and set to true, even though a meta.json has been already found for the block.

Changes

I'm changing the line back to partialBlocks[id] = false

Verification

Added a small test to replicate the error.

@waltherlee waltherlee changed the title Bug: Compactor tags and deletes blocks with marks Bug: Compactor lists blocks with marks as partial Jan 5, 2026
Copy link
Member

@GiedriusS GiedriusS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 🙇

@GiedriusS GiedriusS merged commit 6a888ef into thanos-io:main Jan 8, 2026
45 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants