diff --git a/db/sg_replicate_cfg.go b/db/sg_replicate_cfg.go index cf136a4e8f..37164152fb 100644 --- a/db/sg_replicate_cfg.go +++ b/db/sg_replicate_cfg.go @@ -833,6 +833,10 @@ func (m *sgReplicateManager) SubscribeCfgChanges(ctx context.Context) error { base.DebugfCtx(m.loggingCtx, base.KeyCluster, "Error subscribing to %s key changes: %v", cfgKeySGRCluster, err) return err } + err = m.RefreshReplicationCfg(ctx) + if err != nil { + base.WarnfCtx(m.loggingCtx, "Error while updating refreshing replications before subscribing to cfg: %v", err) + } m.closeWg.Add(1) go func() { defer base.FatalPanicHandler() diff --git a/rest/replicatortest/replicator_test.go b/rest/replicatortest/replicator_test.go index 0a9ab04cc9..8fe7c5b7f8 100644 --- a/rest/replicatortest/replicator_test.go +++ b/rest/replicatortest/replicator_test.go @@ -946,7 +946,7 @@ func TestReplicationConcurrentPush(t *testing.T) { base.LongRunningTest(t) base.RequireNumTestBuckets(t, 2) - base.SetUpTestLogging(t, base.LevelInfo, base.KeyAll) + base.SetUpTestLogging(t, base.LevelDebug, base.KeyAll) // Disable sequence batching for multi-RT tests (pending CBG-1000) defer db.SuspendSequenceBatching()() @@ -959,9 +959,8 @@ func TestReplicationConcurrentPush(t *testing.T) { // Create push replication, wait for assigned replication (this gives time for the first replication to be created and start initializing), // verify running, then create second replication, verify running and verify both replicators are initialized on sgReplicateManager activeRT.CreateReplication("rep_ABC", remoteURLString, db.ActiveReplicatorTypePush, []string{"ABC"}, true, db.ConflictResolverDefault) - activeRT.WaitForReplicationStatus("rep_ABC", db.ReplicationStateRunning) - activeRT.WaitForAssignedReplications(1) activeRT.CreateReplication("rep_DEF", remoteURLString, db.ActiveReplicatorTypePush, []string{"DEF"}, true, db.ConflictResolverDefault) + activeRT.WaitForReplicationStatus("rep_ABC", db.ReplicationStateRunning) activeRT.WaitForReplicationStatus("rep_DEF", db.ReplicationStateRunning) activeRT.WaitForActiveReplicatorInitialization(2)