Skip enabling direct gets if no commits (#4576)

This commit is contained in:
Waldemar Quevedo
2023-09-22 17:25:35 -07:00
committed by GitHub

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