Skip to content

Commit

Permalink
Skip enabling direct gets if no commits (#4576)
Browse files Browse the repository at this point in the history
  • Loading branch information
wallyqs committed Sep 23, 2023
2 parents bbe172d + 89d33d9 commit 637d8f2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/jetstream_cluster.go
Expand Up @@ -2423,6 +2423,10 @@ func (js *jetStream) monitorStream(mset *stream, sa *streamAssignment, sendSnaps
// We are not current, but current means exactly caught up. Under heavy publish
// loads we may never reach this, so check if we are within 90% caught up.
_, c, a := mset.node.Progress()
if c == 0 {
mset.mu.Unlock()
continue
}
if p := float64(a) / float64(c) * 100.0; p < syncThreshold {
mset.mu.Unlock()
continue
Expand Down

0 comments on commit 637d8f2

Please sign in to comment.