mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user