mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 08:38:27 -05:00
c789fb0aa7
Redis 7.0 has #9890 which added an assertion when the propagation queue was not flushed and we got to beforeSleep. But it turns out that when processCommands calls getNodeByQuery and decides to reject the command, it can lead to a key that was lazy expired and is deleted without later flushing the propagation queue. This change prevents lazy expiry from deleting the key at this stage (not as part of a command being processed in `call`)
17 lines
498 B
Tcl
17 lines
498 B
Tcl
start_cluster 2 2 {tags {external:skip cluster}} {
|
|
test {Key lazy expires during key migration} {
|
|
R 0 DEBUG SET-ACTIVE-EXPIRE 0
|
|
|
|
set key_slot [R 0 CLUSTER KEYSLOT FOO]
|
|
R 0 set FOO BAR PX 10
|
|
set src_id [R 0 CLUSTER MYID]
|
|
set trg_id [R 1 CLUSTER MYID]
|
|
R 0 CLUSTER SETSLOT $key_slot MIGRATING $trg_id
|
|
R 1 CLUSTER SETSLOT $key_slot IMPORTING $src_id
|
|
after 11
|
|
assert_error {ASK*} {R 0 GET FOO}
|
|
R 0 ping
|
|
} {PONG}
|
|
}
|
|
|