From d1ba7000427a45b1d3e34f35ca2041d026077915 Mon Sep 17 00:00:00 2001 From: Binbin Date: Wed, 2 Oct 2024 04:14:30 +0800 Subject: [PATCH] Avoid timing issue in diskless-load-swapdb test (#1077) Since we paused the primary node earlier, the replica may enter cluster down due to primary node pfail. Here set allow read to prevent subsequent read errors. Signed-off-by: Binbin --- tests/unit/cluster/diskless-load-swapdb.tcl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/unit/cluster/diskless-load-swapdb.tcl b/tests/unit/cluster/diskless-load-swapdb.tcl index 68c2135493..e237fd81de 100644 --- a/tests/unit/cluster/diskless-load-swapdb.tcl +++ b/tests/unit/cluster/diskless-load-swapdb.tcl @@ -78,6 +78,11 @@ test "Main db not affected when fail to diskless load" { fail "Fail to stop the full sync" } + # Since we paused the primary node earlier, the replica may enter + # cluster down due to primary node pfail. Here set allow read to + # prevent subsequent read errors. + $replica config set cluster-allow-reads-when-down yes + # Replica keys and keys to slots map still both are right assert_equal {1} [$replica get $slot0_key] assert_equal $slot0_key [$replica CLUSTER GETKEYSINSLOT 0 1]