Skip to content

Commit 42ce122

Browse files
authored
Fixed issue that shuffle sharding planner return error if block is under visit by other compactor (#5188)
* Updated visit marker check logic in shuffle sharding planner to not return error if block is under visit by other compactor Signed-off-by: Alex Le <[email protected]> * Update changelog Signed-off-by: Alex Le <[email protected]> * trigger workflow Signed-off-by: Alex Le <[email protected]> * trigger workflow Signed-off-by: Alex Le <[email protected]> --------- Signed-off-by: Alex Le <[email protected]>
1 parent c627d80 commit 42ce122

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
* [BUGFIX] Ring: Fix case when dynamodb kv reaches the limit of 25 actions per batch call. #5136
4646
* [BUGFIX] Query-frontend: Fix shardable instant queries do not produce sorted results for `sort`, `sort_desc`, `topk`, `bottomk` functions. #5148, #5170
4747
* [BUGFIX] Querier: Fix `/api/v1/series` returning 5XX instead of 4XX when limits are hit. #5169
48+
* [BUGFIX] Compactor: Fix issue that shuffle sharding planner return error if block is under visit by other compactor. #5188
4849
* [FEATURE] Alertmanager: Add support for time_intervals. #5102
4950

5051
## 1.14.0 2022-12-02

pkg/compactor/shuffle_sharding_planner.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"time"
77

88
"github.com/go-kit/log"
9+
"github.com/go-kit/log/level"
910
"github.com/oklog/ulid"
1011
"github.com/prometheus/client_golang/prometheus"
1112
"github.com/thanos-io/objstore"
@@ -79,7 +80,8 @@ func (p *ShuffleShardingPlanner) Plan(_ context.Context, metasByMinTime []*metad
7980
return nil, fmt.Errorf("unable to get visit marker file for block %s: %s", blockID, err.Error())
8081
}
8182
if !blockVisitMarker.isVisitedByCompactor(p.blockVisitMarkerTimeout, p.ringLifecyclerID) {
82-
return nil, fmt.Errorf("block %s is not visited by current compactor %s", blockID, p.ringLifecyclerID)
83+
level.Warn(p.logger).Log("msg", "block is not visited by current compactor", "block_id", blockID, "compactor_id", p.ringLifecyclerID)
84+
return nil, nil
8385
}
8486

8587
resultMetas = append(resultMetas, b)

pkg/compactor/shuffle_sharding_planner_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ func TestShuffleShardingPlanner_Plan(t *testing.T) {
306306
compactorID: otherCompactor,
307307
},
308308
},
309-
expectedErr: fmt.Errorf("block %s is not visited by current compactor %s", block1ulid.String(), currentCompactor),
309+
expected: []*metadata.Meta{},
310310
},
311311
"test should not compact if visit marker file is expired": {
312312
ranges: []int64{2 * time.Hour.Milliseconds()},
@@ -333,7 +333,7 @@ func TestShuffleShardingPlanner_Plan(t *testing.T) {
333333
compactorID: currentCompactor,
334334
},
335335
},
336-
expectedErr: fmt.Errorf("block %s is not visited by current compactor %s", block1ulid.String(), currentCompactor),
336+
expected: []*metadata.Meta{},
337337
},
338338
}
339339

0 commit comments

Comments
 (0)