Fix delKeysInSlot server events are not executed inside an execution unit (#12745)

This is a follow-up fix to #12733. We need to apply the same changes to
delKeysInSlot. Refer to #12733 for more details.

This PR contains some other minor cleanups / improvements to the test
suite and docs.
It uses the postnotifications test module in a cluster mode test which
revealed a leak in the test module (fixed).
This commit is contained in:
Binbin
2023-12-11 20:15:19 +02:00
committed by GitHub
parent 62419c01db
commit c85a9b7896
5 changed files with 22 additions and 10 deletions
+7 -3
View File
@@ -163,21 +163,23 @@ start_cluster 3 0 [list config_lines $modules] {
$node2_rd close
}
set modules [list loadmodule [file normalize tests/modules/keyspace_events.so]]
set testmodule_keyspace_events [file normalize tests/modules/keyspace_events.so]
set testmodule_postnotifications "[file normalize tests/modules/postnotifications.so] with_key_events"
set modules [list loadmodule $testmodule_keyspace_events loadmodule $testmodule_postnotifications]
start_cluster 2 2 [list config_lines $modules] {
set master1 [srv 0 client]
set master2 [srv -1 client]
set replica1 [srv -2 client]
set replica2 [srv -3 client]
test "Verify keys deletion and notification effects happened on cluster slots change are replicated inside multi exec" {
$master2 set count_dels_{4oi} 1
$master2 del count_dels_{4oi}
assert_equal 1 [$master2 keyspace.get_dels]
assert_equal 1 [$replica2 keyspace.get_dels]
$master2 set count_dels_{4oi} 1
set repl [attach_to_replication_stream_on_connection -3]
$master1 cluster bumpepoch
@@ -195,10 +197,12 @@ start_cluster 2 2 [list config_lines $modules] {
fail "replica did not increase del counter"
}
# the {lpush before_deleted count_dels_{4oi}} is a post notification job registered when 'count_dels_{4oi}' was removed
assert_replication_stream $repl {
{multi}
{del count_dels_{4oi}}
{keyspace.incr_dels}
{lpush before_deleted count_dels_{4oi}}
{exec}
}
close_replication_stream $repl