From f302c9fda27a955ae676003ab4afe3e44fceca2a Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 21 Jan 2017 13:58:56 -0800 Subject: [PATCH] always send the leader info on each heartbeat --- weed/server/master_grpc_server.go | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/weed/server/master_grpc_server.go b/weed/server/master_grpc_server.go index 8a9117b1e..e91e904bd 100644 --- a/weed/server/master_grpc_server.go +++ b/weed/server/master_grpc_server.go @@ -66,16 +66,14 @@ func (ms MasterServer) SendHeartbeat(stream pb.Seaweed_SendHeartbeatServer) erro return err } - if !t.IsLeader() { - newLeader, err := t.Leader() - if err == nil { - if err := stream.Send(&pb.HeartbeatResponse{ - Leader: newLeader, - }); err != nil { - return err - } + // tell the volume servers about the leader + newLeader, err := t.Leader() + if err == nil { + if err := stream.Send(&pb.HeartbeatResponse{ + Leader: newLeader, + }); err != nil { + return err } } - } }