Skip to content

Commit

Permalink
Ensure timer max query level always above min level (#2944)
Browse files Browse the repository at this point in the history
  • Loading branch information
yycptt committed Jun 3, 2022
1 parent dfbcdce commit d1f73ad
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions service/history/timerQueueAckMgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ import (
"sync"
"time"

"go.temporal.io/server/common"
"go.temporal.io/server/common/log"
"go.temporal.io/server/common/log/tag"
"go.temporal.io/server/common/metrics"
"go.temporal.io/server/common/persistence"
"go.temporal.io/server/common/primitives/timestamp"
ctasks "go.temporal.io/server/common/tasks"
"go.temporal.io/server/service/history/configs"
"go.temporal.io/server/service/history/queues"
"go.temporal.io/server/service/history/shard"
"go.temporal.io/server/service/history/tasks"

"go.temporal.io/server/common/log"
"go.temporal.io/server/common/log/tag"
"go.temporal.io/server/common/metrics"
"go.temporal.io/server/common/persistence"
)

var (
Expand Down Expand Up @@ -177,6 +177,7 @@ func (t *timerQueueAckMgrImpl) getFinishedChan() <-chan struct{} {
func (t *timerQueueAckMgrImpl) readTimerTasks() ([]queues.Executable, *time.Time, bool, error) {
if t.maxQueryLevel == t.minQueryLevel {
t.maxQueryLevel = t.shard.GetQueueMaxReadLevel(tasks.CategoryTimer, t.clusterName).FireTime
t.maxQueryLevel = common.MaxTime(t.minQueryLevel, t.maxQueryLevel)
}
minQueryLevel := t.minQueryLevel
maxQueryLevel := t.maxQueryLevel
Expand Down

0 comments on commit d1f73ad

Please sign in to comment.