mirror of
https://github.com/valkey-io/valkey.git
synced 2026-05-06 05:26:42 -04:00
8a4a7b25dc
Implemented CLUSTERSCAN command for topology-aware scanning
Unlike `SCAN` which is local to a single node, `CLUSTERSCAN` provides a
mechanism that helps clients iterate across slot boundaries and handles
`MOVED` redirections.
**Key details**
* Global cluster iteration via `fingerprint-{hashtag}-cursor`
* Scan one slot at a time
* Start the CLUSTERSCAN with 0
* SLOT argument for parallel scanning of multiple slots
* Re-use scanGenericCommand for the response
**Cursor format:** `fingerprint-{hashtag}-localcursor`
- Fingerprint is a hash of the node's DB seed that identifies the
current memory layout. On mismatch, scan restarts from cursor 0
rather than returning an error.
- Fingerprint 0 indicates a cross slot cursor (e.g., initial cursor
or slot transition) where validation is skipped.
- Hashtag encodes the target slot
- Local cursor tracks position within the slot
**Usage:**
```
CLUSTERSCAN <cursor> [MATCH pattern] [COUNT count] [TYPE type] [SLOT number]
```
```
CLUSTERSCAN 0 # Start scanning from slot 0
CLUSTERSCAN <cursor> # Continue from cursor
CLUSTERSCAN 0 SLOT 1000 # Start scanning specific slot
CLUSTERSCAN <cursor> MATCH user:* COUNT 100
```
---------
Signed-off-by: nmvk <r@nmvk.com>
Signed-off-by: Raghav <r@nmvk.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
77 lines
1.2 KiB
TOML
77 lines
1.2 KiB
TOML
# See https://github.com/crate-ci/typos/blob/master/docs/reference.md to configure typos
|
|
|
|
[files]
|
|
extend-exclude = [
|
|
".git/",
|
|
"deps/",
|
|
# crc16_slottable is primarily pre-generated random strings.
|
|
"src/crc16_slottable.c",
|
|
]
|
|
ignore-hidden = false
|
|
|
|
[default.extend-words]
|
|
exat = "exat"
|
|
optin = "optin"
|
|
smove = "smove"
|
|
Parth = "Parth" # seems like the spellchecker does not like it is similar to "Path"
|
|
nd = "nd"
|
|
|
|
[default]
|
|
extend-ignore-re = [
|
|
"SELECTed",
|
|
"WATCHed",
|
|
]
|
|
|
|
[type.c]
|
|
extend-ignore-re = [
|
|
"BA3E2571", # sha1.c
|
|
"D4C4DAA4", # sha1.c
|
|
"Georg Nees",
|
|
"\\[l\\]ist", # eval.c
|
|
'"LKE"', # test_rax.c
|
|
]
|
|
|
|
[type.tcl]
|
|
extend-ignore-re = [
|
|
"DUMPed",
|
|
]
|
|
|
|
[type.c.extend-identifiers]
|
|
advices = "advices"
|
|
clen = "clen"
|
|
fle = "fle"
|
|
ot = "ot"
|
|
|
|
[type.tcl.extend-identifiers]
|
|
oll = "oll"
|
|
stressers = "stressers"
|
|
|
|
[type.sv.extend-identifiers]
|
|
# sv = .h
|
|
fo = "fo"
|
|
|
|
[type.sv.extend-words]
|
|
# sv = .h
|
|
seeked = "seeked"
|
|
|
|
[type.c.extend-words]
|
|
arange = "arange"
|
|
fo = "fo"
|
|
frst = "frst"
|
|
limite = "limite"
|
|
pathc = "pathc"
|
|
pn = "pn"
|
|
seeked = "seeked"
|
|
tre = "tre"
|
|
|
|
[type.systemd.extend-words]
|
|
# systemd = .conf
|
|
ake = "ake"
|
|
|
|
[type.tcl.extend-words]
|
|
fo = "fo"
|
|
tre = "tre"
|
|
|
|
[type.cpp.extend-words]
|
|
fo = "fo"
|