valkey-io/valkey-glide

SCAN command for cluster mode - redis-rs impl'

Closed this issue · 0 comments

SCAN is complex to implement over cluster mode. We need some way to iterate over all the slots, without missing values due to topology changes / slot migrations.
We can take a hint from the ElastiCache serverless SCAN implementation.

Suggested high-level implementation -
since we're allowed to send the same value twice, we can keep a list of finished slots. We iterate over nodes serially. Once we scan over a node successfully, we'll mark all of its slots as finished. if a topology refresh happens while iterating over a node, we restart the process for all unfinished slots.