aboutsummaryrefslogtreecommitdiff
path: root/weed/cluster
diff options
context:
space:
mode:
authorKonstantin Lebedev <9497591+kmlebedev@users.noreply.github.com>2022-04-06 21:17:04 +0500
committerKonstantin Lebedev <9497591+kmlebedev@users.noreply.github.com>2022-04-06 21:17:04 +0500
commit14a2cc83bf35c2c30bb2306cca128ca8a1eb8286 (patch)
tree171c09b2705b3899a3f7dbdf557524f3bc5d0985 /weed/cluster
parent357aa818fe6b8165c2af7bbccbbb7ffa1cd22f3c (diff)
downloadseaweedfs-14a2cc83bf35c2c30bb2306cca128ca8a1eb8286.tar.xz
seaweedfs-14a2cc83bf35c2c30bb2306cca128ca8a1eb8286.zip
raft update peers via OnPeerUpdate
Diffstat (limited to 'weed/cluster')
-rw-r--r--weed/cluster/cluster.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/weed/cluster/cluster.go b/weed/cluster/cluster.go
index e8752f4d9..3cff13724 100644
--- a/weed/cluster/cluster.go
+++ b/weed/cluster/cluster.go
@@ -81,6 +81,15 @@ func (cluster *Cluster) AddClusterNode(nodeType string, address pb.ServerAddress
},
}
case MasterType:
+ return []*master_pb.KeepConnectedResponse{
+ {
+ ClusterNodeUpdate: &master_pb.ClusterNodeUpdate{
+ NodeType: nodeType,
+ Address: string(address),
+ IsAdd: true,
+ },
+ },
+ }
}
return nil
}
@@ -120,6 +129,15 @@ func (cluster *Cluster) RemoveClusterNode(nodeType string, address pb.ServerAddr
}
}
case MasterType:
+ return []*master_pb.KeepConnectedResponse{
+ {
+ ClusterNodeUpdate: &master_pb.ClusterNodeUpdate{
+ NodeType: nodeType,
+ Address: string(address),
+ IsAdd: false,
+ },
+ },
+ }
}
return nil
}