Commit 30a0a48
feat(cluster): add opt-in PreferClusterShards to use CLUSTER SHARDS before version 8 (#181)
* feat(cluster): add opt-in PreferClusterShards to use CLUSTER SHARDS before version 8
By default the client refreshes cluster topology with CLUSTER SHARDS only on
servers version 8 and above, and uses CLUSTER SLOTS below that. This was done
because CLUSTER SHARDS had a server side bug on older versions.
The bug is fixed in Valkey 7.2.6 and Redis 8.0, so users on those versions can
now opt in to CLUSTER SHARDS earlier by setting PreferClusterShards. This keeps
the health field from CLUSTER SHARDS during rolling engine upgrades, which
avoids routing commands to nodes that are still loading.
The option is off by default so existing behavior does not change. It only
takes effect on servers version 7 and above, so it never sends CLUSTER SHARDS
to a server that does not support the command.
Signed-off-by: DhruvilK7 <dhruvil.kakadiya@zomato.com>
* Apply batched suggestions from code review
Co-authored-by: Rueian <rueiancsie@gmail.com>
Signed-off-by: Rueian <rueiancsie@gmail.com>
---------
Signed-off-by: DhruvilK7 <dhruvil.kakadiya@zomato.com>
Signed-off-by: Rueian <rueiancsie@gmail.com>
Co-authored-by: Rueian <rueiancsie@gmail.com>
Signed-off-by: Rueian <rueiancsie@gmail.com>1 parent 4d7ae1a commit 30a0a48
3 files changed
Lines changed: 57 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
201 | | - | |
202 | | - | |
203 | | - | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
| 207 | + | |
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
| 213 | + | |
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
224 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
225 | 228 | | |
226 | | - | |
| 229 | + | |
227 | 230 | | |
228 | 231 | | |
229 | 232 | | |
| |||
429 | 432 | | |
430 | 433 | | |
431 | 434 | | |
| 435 | + | |
432 | 436 | | |
433 | 437 | | |
434 | 438 | | |
435 | 439 | | |
436 | 440 | | |
437 | 441 | | |
438 | | - | |
439 | | - | |
440 | | - | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
441 | 445 | | |
442 | 446 | | |
443 | 447 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6295 | 6295 | | |
6296 | 6296 | | |
6297 | 6297 | | |
| 6298 | + | |
| 6299 | + | |
| 6300 | + | |
| 6301 | + | |
| 6302 | + | |
| 6303 | + | |
| 6304 | + | |
| 6305 | + | |
| 6306 | + | |
| 6307 | + | |
| 6308 | + | |
| 6309 | + | |
| 6310 | + | |
| 6311 | + | |
| 6312 | + | |
| 6313 | + | |
| 6314 | + | |
| 6315 | + | |
| 6316 | + | |
| 6317 | + | |
| 6318 | + | |
| 6319 | + | |
| 6320 | + | |
| 6321 | + | |
| 6322 | + | |
| 6323 | + | |
| 6324 | + | |
| 6325 | + | |
| 6326 | + | |
| 6327 | + | |
| 6328 | + | |
| 6329 | + | |
| 6330 | + | |
| 6331 | + | |
6298 | 6332 | | |
6299 | 6333 | | |
6300 | 6334 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
340 | 348 | | |
341 | 349 | | |
342 | 350 | | |
| |||
0 commit comments