Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix -compact.skip-block-with-out-of-order-chunks #4566

Merged
merged 1 commit into from
Aug 16, 2021

Conversation

pracucci
Copy link
Contributor

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

The PR #4469 was just merged but I've the feeling it's not correct. The problem is that when the skip is disabled it should still be a critical error while right now the error is ignored at all (see comment annotation in the PR).

Also, from a design perspective, I don't think it's the responsibility of the grouper to know if skipping is enabled or not, so I've moved that config to the BucketCompactor.

Verification

Existing tests.

Signed-off-by: Marco Pracucci <marco@pracucci.com>
@@ -783,7 +776,7 @@ func (cg *Group) compact(ctx context.Context, dir string, planner Planner, comp
return false, ulid.ULID{}, halt(errors.Wrapf(err, "block with not healthy index found %s; Compaction level %v; Labels: %v", bdir, meta.Compaction.Level, meta.Thanos.Labels))
}

if err := stats.OutOfOrderChunksErr(); cg.skipChunksWithOutofOrderBlocks && err != nil {
if err := stats.OutOfOrderChunksErr(); err != nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

With the code in main, if cg.skipChunksWithOutofOrderBlocks is false then we don't return error but we do toCompactDirs = append(toCompactDirs, bdir) below, which is wrong.

// If block has out of order chunk and it has been configured to skip it,
// then we can mark the block for no compaction so that the next compaction run
// will skip it.
if IsOutOfOrderChunkError(err) && c.skipBlocksWithOutOfOrderChunks {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe this is the right place where we should check for skipBlocksWithOutOfOrderChunks. If enabled (which means we skip it), then we do mark the block for no-compaction and we continue processing the next job from the queue. If disabled (which means we don't skip the block) then we should error out (done below).

@GiedriusS
Copy link
Member

@huyan0 @yeya24 could you please take a look?

@huyan0
Copy link
Contributor

huyan0 commented Aug 13, 2021

LGTM, thanks for the fix.

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.

👍 thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants