-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Fix -compact.skip-block-with-out-of-order-chunks #4566
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
Conversation
Signed-off-by: Marco Pracucci <[email protected]>
@@ -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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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).
LGTM, thanks for the fix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 thx
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.