@@ -39,9 +39,9 @@ proc check_myhash_and_expired_subkeys {r myhash expected_len initial_expired exp
39
39
proc get_short_expire_value {command} {
40
40
expr {
41
41
($command eq " HEXPIRE" || $command eq " EX" ) ? 1 :
42
- ($command eq " HPEXPIRE" || $command eq " PX" ) ? 10 :
42
+ ($command eq " HPEXPIRE" || $command eq " PX" ) ? 1000 :
43
43
($command eq " HEXPIREAT" || $command eq " EXAT" ) ? [clock seconds] + 1 :
44
- [clock milliseconds] + 10
44
+ [clock milliseconds] + 1000
45
45
}
46
46
}
47
47
@@ -2385,13 +2385,29 @@ start_server {tags {"hashexpire external:skip"}} {
2385
2385
assert_equal {1} [psubscribe $rd_replica_2 __keyevent@*]
2386
2386
2387
2387
# Create hash and timing - f1 < f2 < f3 expiry times
2388
- set f1_exp [expr {[clock seconds] + 10000}]
2388
+ set f1_exp [expr {[clock seconds] + 1000000}]
2389
+
2390
+ wait_for_ofs_sync $primary $replica_1
2391
+ wait_for_ofs_sync $replica_1 $replica_2
2389
2392
2390
2393
# ############################################ STEUP HASH #############################################
2391
- $primary HSET myhash f1 v1 f2 v2 ;# Should trigger 3 hset
2394
+ $primary HSETEX myhash FIELDS 2 f1 v1 f2 v2 ;# Should trigger 3 hset
2395
+ wait_for_ofs_sync $primary $replica_1
2396
+ wait_for_ofs_sync $replica_1 $replica_2
2397
+
2398
+ # Verify hset event was generated on all 3 nodes
2399
+ foreach rd [list $rd_primary $rd_replica_1 $rd_replica_2 ] {
2400
+ assert_keyevent_patterns $rd myhash hset
2401
+ }
2402
+
2392
2403
$primary HEXPIREAT myhash $f1_exp FIELDS 1 f1 ;# Should trigger 3 hexpire
2393
2404
wait_for_ofs_sync $primary $replica_1
2394
2405
wait_for_ofs_sync $replica_1 $replica_2
2406
+
2407
+ # Verify hexpire event was generated on all 3 nodes
2408
+ foreach rd [list $rd_primary $rd_replica_1 $rd_replica_2 ] {
2409
+ assert_keyevent_patterns $rd myhash hexpire
2410
+ }
2395
2411
2396
2412
$primary HPEXPIRE myhash 0 FIELDS 1 f1 ;# Should trigger 1 hexpired (for primary) and 2 hdel (for replicas)
2397
2413
wait_for_ofs_sync $primary $replica_1
@@ -2408,9 +2424,6 @@ start_server {tags {"hashexpire external:skip"}} {
2408
2424
}
2409
2425
2410
2426
# primary gets hexpired and replicas get hdel
2411
- foreach rd [list $rd_primary $rd_replica_1 $rd_replica_2 ] {
2412
- assert_keyevent_patterns $rd myhash hset hexpire
2413
- }
2414
2427
assert_keyevent_patterns $rd_primary myhash hexpired
2415
2428
assert_keyevent_patterns $rd_replica_1 myhash hdel
2416
2429
assert_keyevent_patterns $rd_replica_2 myhash hdel
0 commit comments