Skip to content

Commit

Permalink
Only process restore request in the current alpha if it's the leader. (
Browse files Browse the repository at this point in the history
…#5657)

Requests for other groups are being sent to the leader but the request
for the group the received the request might not be sent to the leader.
Fix that by first checking if the alpha is the leader. If not, the
request is sent to the leader.
  • Loading branch information
martinmr committed Jun 18, 2020
1 parent b69eb8e commit 64a9438
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion worker/online_restore_ee.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func ProcessRestoreRequest(ctx context.Context, req *pb.RestoreRequest) error {
}

func proposeRestoreOrSend(ctx context.Context, req *pb.RestoreRequest) error {
if groups().ServesGroup(req.GetGroupId()) {
if groups().ServesGroup(req.GetGroupId()) && groups().Node.AmLeader() {
_, err := (&grpcWorker{}).Restore(ctx, req)
return err
}
Expand Down

0 comments on commit 64a9438

Please sign in to comment.