Skip enabling direct gets if no commits

Signed-off-by: Waldemar Quevedo <wally@nats.io>
This commit is contained in:
Waldemar Quevedo
2023-09-22 17:08:46 -07:00
parent ece431fc74
commit 89d33d960b

View File

@@ -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