Skip to content

fix: Don't check for existing replicas when starting up #4587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions enterprise/replicasync/replicasync.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,6 @@ func New(ctx context.Context, logger slog.Logger, db database.Store, pubsub data
if err != nil {
return nil, xerrors.Errorf("run replica: %w", err)
}
peers := manager.Regional()
if len(peers) > 0 {
self := manager.Self()
if self.RelayAddress == "" {
return nil, xerrors.Errorf("a relay address must be specified when running multiple replicas in the same region")
}
}

err = manager.subscribe(ctx)
if err != nil {
return nil, xerrors.Errorf("subscribe: %w", err)
Expand Down
17 changes: 0 additions & 17 deletions enterprise/replicasync/replicasync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,6 @@ func TestReplica(t *testing.T) {
_ = server.Close()
require.NoError(t, err)
})
t.Run("ErrorsWithoutRelayAddress", func(t *testing.T) {
// Ensures that the replica reports a successful status for
// accessing all of its peers.
t.Parallel()
db, pubsub := dbtestutil.NewDB(t)
_, err := db.InsertReplica(context.Background(), database.InsertReplicaParams{
ID: uuid.New(),
CreatedAt: database.Now(),
StartedAt: database.Now(),
UpdatedAt: database.Now(),
Hostname: "something",
})
require.NoError(t, err)
_, err = replicasync.New(context.Background(), slogtest.Make(t, nil), db, pubsub, nil)
require.Error(t, err)
require.Equal(t, "a relay address must be specified when running multiple replicas in the same region", err.Error())
})
t.Run("ConnectsToPeerReplica", func(t *testing.T) {
// Ensures that the replica reports a successful status for
// accessing all of its peers.
Expand Down