Commit 74a61d3
committed
Add the :nearest_slave role for Sentinel mode
This will cause the client to measure roundtrip latency to each slave
and select the slave with the lowest latency. The intent for this is
to enable sentinel-managed clusters of servers for which eventually-consistent
reads are acceptable, but to maintain minimum latencies between any
individual client-slave pair.
The case I did this for is is shared web application caching across multiple
datacenters, where you would not want Redis to connect to a slave in another
datacenter, but you would want all datacenters to share a cache.1 parent ea89435 commit 74a61d3
2 files changed
+77
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
483 | 483 | | |
484 | 484 | | |
485 | 485 | | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
486 | 490 | | |
487 | 491 | | |
488 | 492 | | |
| |||
505 | 509 | | |
506 | 510 | | |
507 | 511 | | |
508 | | - | |
| 512 | + | |
509 | 513 | | |
510 | | - | |
| 514 | + | |
511 | 515 | | |
512 | 516 | | |
513 | 517 | | |
| |||
517 | 521 | | |
518 | 522 | | |
519 | 523 | | |
| 524 | + | |
| 525 | + | |
520 | 526 | | |
521 | 527 | | |
522 | 528 | | |
| |||
566 | 572 | | |
567 | 573 | | |
568 | 574 | | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
569 | 600 | | |
570 | 601 | | |
571 | 602 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
255 | 299 | | |
0 commit comments