When moving streams, we could check too soon and be in a gap where the replica peer has not registered a catchup request.

This would cause us to think the replica was caughtup incorrectly and drop our leadership, which would cancel any cacthup requests.

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2023-08-21 20:07:48 -07:00
parent 2fc3f45ea1
commit e5d208bf33
3 changed files with 65 additions and 15 deletions

View File

@@ -2161,21 +2161,11 @@ func (js *jetStream) monitorStream(mset *stream, sa *streamAssignment, sendSnaps
startMigrationMonitoring := func() {
if mmt == nil {
mmt = time.NewTicker(10 * time.Millisecond)
mmt = time.NewTicker(500 * time.Millisecond)
mmtc = mmt.C
}
}
adjustMigrationMonitoring := func() {
const delay = 500 * time.Millisecond
if mmt == nil {
mmt = time.NewTicker(delay)
mmtc = mmt.C
} else {
mmt.Reset(delay)
}
}
stopMigrationMonitoring := func() {
if mmt != nil {
mmt.Stop()
@@ -2407,9 +2397,6 @@ func (js *jetStream) monitorStream(mset *stream, sa *streamAssignment, sendSnaps
continue
}
// Adjust to our normal time delay.
adjustMigrationMonitoring()
// Make sure we have correct cluster information on the other peers.
ci := js.clusterInfo(rg)
mset.checkClusterInfo(ci)