MCPcopy Create free account
hub / github.com/apache/kvrocks-controller / SyncClusterInfo

Method SyncClusterInfo

store/cluster_node.go:244–255  ·  view source on GitHub ↗
(ctx context.Context, cluster *Cluster)

Source from the content-addressed store, hash-verified

242}
243
244func (n *ClusterNode) SyncClusterInfo(ctx context.Context, cluster *Cluster) error {
245 clusterStr, err := cluster.ToSlotString()
246 if err != nil {
247 return err
248 }
249 redisCli := n.GetClient()
250 err = redisCli.Do(ctx, "CLUSTERX", "SETNODEID", n.id).Err()
251 if err != nil {
252 return err
253 }
254 return redisCli.Do(ctx, "CLUSTERX", "SETNODES", clusterStr, cluster.Version.Load()).Err()
255}
256
257func (n *ClusterNode) Reset(ctx context.Context) error {
258 if n.IsMaster() {

Callers 2

TestClusterNodeFunction · 0.95
TestClusterImportFunction · 0.95

Calls 2

GetClientMethod · 0.95
ToSlotStringMethod · 0.80

Tested by 2

TestClusterNodeFunction · 0.76
TestClusterImportFunction · 0.76