greatsharp commented on code in PR #324:
URL: 
https://github.com/apache/kvrocks-controller/pull/324#discussion_r2203755527


##########
server/route.go:
##########
@@ -69,7 +69,7 @@ func (srv *Server) initHandlers() {
                        clusters.POST("/:cluster/import", 
middleware.RequiredNamespace, handler.Cluster.Import)
                        clusters.GET("/:cluster", middleware.RequiredCluster, 
handler.Cluster.Get)
                        clusters.DELETE("/:cluster", 
middleware.RequiredCluster, handler.Cluster.Remove)
-                       clusters.POST("/:cluster/migrate", 
middleware.RequiredCluster, handler.Cluster.MigrateSlot)
+                       clusters.POST("/:cluster/migrate", 
handler.Cluster.MigrateSlot)

Review Comment:
   middleware.RequiredCluster,it finds cluster from storage, then put into the 
gin context.
   
   If requests get the cluster info before MigrateSlot method, if the cluster's 
source and target shard are not doing migrating at this time, then all request 
can send "CLUSTERX MIGRATE" cmd to kvrocks node.
   At last, the controller's migrating_slot will not match the kvrocks node's.
   
   To resolve this mismatch,  we should get the cluster info after the mutex in 
each request.
   
   
   
   



-- 
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