Skip to content

Commit

Permalink
updates after comments to address race more
Browse files Browse the repository at this point in the history
  • Loading branch information
gregns1 committed Apr 17, 2023
1 parent 5fcacd4 commit 1fb92c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 4 additions & 0 deletions db/sg_replicate_cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
5 changes: 2 additions & 3 deletions rest/replicatortest/replicator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()()
Expand All @@ -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)

Expand Down

0 comments on commit 1fb92c8

Please sign in to comment.