git-hulk commented on code in PR #237:
URL: 
https://github.com/apache/kvrocks-controller/pull/237#discussion_r1895843036


##########
store/cluster.go:
##########
@@ -77,6 +77,18 @@ func NewCluster(name string, nodes []string, replicas int) 
(*Cluster, error) {
        return cluster, nil
 }
 
+func (cluster *Cluster) Clone() *Cluster {
+       clone := &Cluster{
+               Name:   cluster.Name,
+               Shards: make([]*Shard, 0),
+       }
+       clone.Version.Store(cluster.Version.Load())
+       for _, shard := range cluster.Shards {

Review Comment:
   Good catch, it should be better to clone with the lock guard.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to