Skip to content

Commit ecf3887

Browse files
yycpttchaptersix
authored andcommitted
Fix queue slice count action (#8550)
## What changed? - Revert the removal of slice count check in multi-cursor slice count action. - The check was incorrectly removed in [#8416 L117](https://github.com/temporalio/temporal/pull/8416/files#diff-deecce1e374d8c4db074d9c923c2b80d1b8e28cef778202aa01397e8d56e1bafL117) ## Why? - Without the check, the code will panic later in `pickCompactCandidates` when currentSliceCount < targetSliceCount. ## How did you test it? - [x] built - [ ] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) - [x] will follow up with a test PR
1 parent 6086881 commit ecf3887

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

service/history/queues/action_slice_count.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ func (a *actionSliceCount) findAndCompactLowSliceCount(
116116
targetSliceCount int,
117117
) bool {
118118
currentSliceCount := a.monitor.GetTotalSliceCount()
119+
if currentSliceCount <= targetSliceCount {
120+
return true
121+
}
122+
119123
candidates := make([]compactCandidate, 0, currentSliceCount)
120124
for readerID, reader := range readers {
121125
if !readerPredicate(readerID) {

0 commit comments

Comments
 (0)