Skip to content

feat(filter): add allow_slot and block_slot rules - #1068

Merged
suxb201 merged 3 commits into
tair-opensource:v4from
HiranmoyChowdhury:v4
Oct 16, 2026
Merged

suxb201 merged 3 commits into
tair-opensource:v4from
HiranmoyChowdhury:v4

Conversation

@HiranmoyChowdhury

@HiranmoyChowdhury HiranmoyChowdhury commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Adds allow_slot / block_slot filter rules, so commands can be kept or dropped by the hash slot of their keys:

[filter]
allow_slot = ["0-5460", "15627"]

Both are empty by default, so nothing changes unless you set them. Commands without keys aren't affected.

Why: I'm replaying per-shard AOF files into a cluster for point-in-time recovery. If slots moved between shards (reshard/rebalance) during that period, the source shard's migration DEL can wipe keys already restored from the destination shard, or the replay hits BUSYKEY. The result depends on replay order. Limiting each shard's replay to the slots it owned at the target time fixes it.

This is possible with a Lua function using SLOTS too, but a built-in rule is simpler and matches the other allow/block filters.

Tested on a 3-shard cluster with a reshard and rebalance during writes. Without the rule, about 1,000 keys went missing or had wrong values after restore. With it, every key matched, in any replay order.

Signed-off-by: HiranmoyChowdhury hiranmoy.das70@gmail.com

Signed-off-by: HiranmoyChowdhury <hiranmoy@appscode.com>
@HiranmoyChowdhury
HiranmoyChowdhury marked this pull request as draft October 15, 2026 09:28
Signed-off-by: HiranmoyChowdhury <hiranmoy@appscode.com>
Signed-off-by: HiranmoyChowdhury <hiranmoy@appscode.com>
@HiranmoyChowdhury
HiranmoyChowdhury marked this pull request as ready for review October 15, 2026 12:46
@suxb201
suxb201 merged commit 502703e into tair-opensource:v4 Oct 16, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants