bseto opened a new pull request, #304:
URL: https://github.com/apache/kvrocks-controller/pull/304

   This PR addresses #214 somewhat. 
   
   From my understanding the current flow in the controller is:
   ```sh
   # Step 1
   clusterx migrate <slot range> <ID>  # to trigger a migration
   # Step 2 - eventually after migration is over
   clusterx setslot <slot range> <ID>  # to set the topology
   ```
   
   These changes do not allow for:
   1. The input parameter to accept multiple ranges
   2. The range to stretch across multiple source shards. 
   
   This way, the controller does not need to be modified to perform multiple 
`step 1`s followed by `step 2`s
   
   The main change is that `MigrateSlotRequest` accepts a SlotRange instead of 
a int. 
   `slot = -1` used to mean no migration is happening. Now `slot = nil` is the 
equivalent. 
   
   ```
   // from
   type MigrateSlotRequest struct {
        Target   int  `json:"target" validate:"required"`
        Slot     int  `json:"slot" validate:"required"`
        SlotOnly bool `json:"slot_only"`
   }
   // to
   type ClusterInfo struct {
        CurrentEpoch   int64      `json:"cluster_current_epoch"`
        MigratingSlot  *SlotRange `json:"migrating_slot"`
        MigratingState string     `json:"migrating_state"`
   }
   ```


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