Skip to content

Commit 43e30da

Browse files
schadotrrueian
andcommitted
Add atomic slot migration commands for Valkey 9.0 (#88)
* Add atomic slot migration commands for Valkey 9.0 * Resolving PR comments * Fixing gen files * chore: simplify CLUSTER MIGRATESLOTS command Signed-off-by: Rueian <[email protected]> --------- Signed-off-by: Rueian <[email protected]> Co-authored-by: Rueian <[email protected]> Signed-off-by: Rueian <[email protected]>
1 parent ae1e81d commit 43e30da

File tree

3 files changed

+104
-0
lines changed

3 files changed

+104
-0
lines changed

hack/cmds/commands.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,6 +1313,12 @@
13131313
"since": "3.0.0",
13141314
"group": "cluster"
13151315
},
1316+
"CLUSTER CANCELSLOTMIGRATIONS": {
1317+
"summary": "Cancel slot migration operations",
1318+
"complexity": "O(N) where N is the number of active slot migrations",
1319+
"since": "9.0.0",
1320+
"group": "cluster"
1321+
},
13161322
"CLUSTER COUNT-FAILURE-REPORTS": {
13171323
"summary": "Return the number of failure reports active for a given node",
13181324
"complexity": "O(N) where N is the number of failure reports",
@@ -1421,6 +1427,12 @@
14211427
"since": "3.0.0",
14221428
"group": "cluster"
14231429
},
1430+
"CLUSTER GETSLOTMIGRATIONS": {
1431+
"summary": "Return a list of recent slot migrations",
1432+
"complexity": "O(N) where N is the number of slot migration jobs",
1433+
"since": "9.0.0",
1434+
"group": "cluster"
1435+
},
14241436
"CLUSTER INFO": {
14251437
"summary": "Provides info about Redis Cluster node state",
14261438
"complexity": "O(1)",
@@ -1445,6 +1457,32 @@
14451457
"since": "7.0.0",
14461458
"group": "cluster"
14471459
},
1460+
"CLUSTER MIGRATESLOTS": {
1461+
"summary": "Migrate hash slots to target nodes using atomic slot migration",
1462+
"complexity": "O(N) where N is the number of keys in the migrating slots",
1463+
"arguments": [
1464+
{
1465+
"name": "slot-migration-spec",
1466+
"type": "block",
1467+
"multiple": true,
1468+
"arguments": [
1469+
{
1470+
"name": ["start-slot", "end-slot"],
1471+
"type": ["integer", "integer"],
1472+
"multiple": true,
1473+
"command": "SLOTSRANGE"
1474+
},
1475+
{
1476+
"command": "NODE",
1477+
"name": "node-id",
1478+
"type": "string"
1479+
}
1480+
]
1481+
}
1482+
],
1483+
"since": "9.0.0",
1484+
"group": "cluster"
1485+
},
14481486
"CLUSTER MEET": {
14491487
"summary": "Force a node cluster to handshake with another node",
14501488
"complexity": "O(1)",

internal/cmds/gen_cluster.go

Lines changed: 63 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/cmds/gen_cluster_test.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)