You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// SplitKeyspaceGroupByIDParams defines the params for splitting a keyspace group.
type SplitKeyspaceGroupByIDParams struct {
NewID uint32 `json:"new-id"`
Keyspaces []uint32 `json:"keyspaces"`
// StartKeyspaceID and EndKeyspaceID are used to indicate the range of keyspaces to be split.
StartKeyspaceID uint32 `json:"start-keyspace-id"`
EndKeyspaceID uint32 `json:"end-keyspace-id"`
}
func splitKeyspaceGroupCommandFunc(cmd *cobra.Command, args []string) {
if len(args) < 3 {
cmd.Usage()
return
}
_, err := strconv.ParseUint(args[0], 10, 32)
if err != nil {
cmd.Printf("Failed to parse the old keyspace group ID: %s\n", err)
return
}
newID, err := strconv.ParseUint(args[1], 10, 32)
if err != nil {
cmd.Printf("Failed to parse the new keyspace group ID: %s\n", err)
return
}
keyspaces := make([]uint32, 0, len(args)-2)
for _, arg := range args[2:] {
id, err := strconv.ParseUint(arg, 10, 32)
if err != nil {
cmd.Printf("Failed to parse the keyspace ID: %s\n", err)
return
}
keyspaces = append(keyspaces, uint32(id))
}
postJSON(cmd, fmt.Sprintf("%s/%s/split", keyspaceGroupsPrefix, args[0]), map[string]interface{}{
"new-id": uint32(newID),
"keyspaces": keyspaces,
})
The text was updated successfully, but these errors were encountered:
close#6687, close#6688
Add split-range cmd and fix duplicate keyspaces
1. Add split-range cmd to support StartKeyspaceID and EndKeyspaceID parameters.
2. Fix "split 0 2 2 2" generate duplicate keyspaces in the keyspace list of the group"
Signed-off-by: Bin Shi <[email protected]>
binshi-bing
changed the title
pd-ctl doesn't support StartKeyspaceID and EndKeyspaceID parameters
pd-ctl: support StartKeyspaceID and EndKeyspaceID parameters
Jun 29, 2023
rleungx
pushed a commit
to rleungx/pd
that referenced
this issue
Aug 2, 2023
closetikv#6687, closetikv#6688
Add split-range cmd and fix duplicate keyspaces
1. Add split-range cmd to support StartKeyspaceID and EndKeyspaceID parameters.
2. Fix "split 0 2 2 2" generate duplicate keyspaces in the keyspace list of the group"
Signed-off-by: Bin Shi <[email protected]>
rleungx
pushed a commit
to rleungx/pd
that referenced
this issue
Aug 2, 2023
closetikv#6687, closetikv#6688
Add split-range cmd and fix duplicate keyspaces
1. Add split-range cmd to support StartKeyspaceID and EndKeyspaceID parameters.
2. Fix "split 0 2 2 2" generate duplicate keyspaces in the keyspace list of the group"
Signed-off-by: Bin Shi <[email protected]>
Enhancement Task
root@serverless-cluster-pd-0:/# ./pd-ctl keyspace-group split help
Usage:
pd-ctl keyspace-group split <keyspace_group_id> <new_keyspace_group_id> [<keyspace_id>] [flags]
The text was updated successfully, but these errors were encountered: