induce delay prior to scale down (#3381)

This is to avoid a narrow race between adding server and them catching
up where they also register as current.

Also wait for all peers to be caught up.

This also avoids clearing catchup marker once catchup stalled.
A stalled catchup would remove the marker causing the peer to
register as current.

Signed-off-by: Matthias Hanel <mh@synadia.com>
This commit is contained in:
Matthias Hanel
2022-08-18 13:47:40 -07:00
committed by GitHub
parent 2a709aaf61
commit 6bf50dbb77
2 changed files with 50 additions and 26 deletions

View File

@@ -1812,7 +1812,7 @@ func TestJetStreamSuperClusterMovingStreamsAndConsumers(t *testing.T) {
// Should see the cluster designation and leader switch to C2.
// We should also shrink back down to original replica count.
checkFor(t, 10*time.Second, 100*time.Millisecond, func() error {
checkFor(t, 20*time.Second, 100*time.Millisecond, func() error {
si, err := js.StreamInfo("MOVE")
if err != nil {
return err