From 7451c5d12ea3e4903e00c28283190f1199777a25 Mon Sep 17 00:00:00 2001 From: Malavan Sotheeswaran Date: Thu, 29 Dec 2022 17:01:37 -0800 Subject: [PATCH 1/8] force sync unlink when removing rdbtempfile during shutdown --- src/server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server.cpp b/src/server.cpp index 3a1fbbede..222372d26 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -5167,7 +5167,7 @@ int prepareForShutdown(int flags) { * to unlink file actully) in background thread. * The temp rdb file fd may won't be closed when redis exits quickly, * but OS will close this fd when process exits. */ - rdbRemoveTempFile(g_pserver->child_pid, 0); + rdbRemoveTempFile(g_pserver->child_pid, 1); } /* Kill module child if there is one. */ From 5eac72c3fafcff1c744a17fa13d0bfbaf17a1930 Mon Sep 17 00:00:00 2001 From: Malavan Sotheeswaran Date: Tue, 3 Jan 2023 21:50:30 -0800 Subject: [PATCH 2/8] cluster fixes --- src/cluster.cpp | 4 ++-- tests/cluster/tests/includes/init-tests.tcl | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cluster.cpp b/src/cluster.cpp index 7f6d897c9..50a5a9423 100644 --- a/src/cluster.cpp +++ b/src/cluster.cpp @@ -2629,9 +2629,9 @@ void clusterSendPing(clusterLink *link, int type) { * Since we have non-voting slaves that lower the probability of an entry * to feature our node, we set the number of entries per packet as * 10% of the total nodes we have. */ - wanted = floor(dictSize(g_pserver->cluster->nodes)/10); + wanted = floor(dictSize(g_pserver->cluster->nodes)); if (wanted < 3) wanted = 3; - if (wanted > freshnodes) wanted = freshnodes; + //if (wanted > freshnodes) wanted = freshnodes; /* Include all the nodes in PFAIL state, so that failure reports are * faster to propagate to go from PFAIL to FAIL state. */ diff --git a/tests/cluster/tests/includes/init-tests.tcl b/tests/cluster/tests/includes/init-tests.tcl index 466ab8f25..1f7ec8d57 100644 --- a/tests/cluster/tests/includes/init-tests.tcl +++ b/tests/cluster/tests/includes/init-tests.tcl @@ -26,6 +26,7 @@ test "Cluster nodes are reachable" { } test "Cluster nodes hard reset" { + after 60000 foreach_redis_id id { if {$::valgrind} { set node_timeout 10000 From 390a6ae3ab15ad156a34af55e7d6fc43454add21 Mon Sep 17 00:00:00 2001 From: Malavan Sotheeswaran Date: Wed, 4 Jan 2023 17:07:01 -0800 Subject: [PATCH 3/8] single thread ci --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76b18cdbe..972ac36b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,10 +21,10 @@ jobs: - name: test-tls run: | sudo apt-get -y install tcl tcl-tls - ./runtest --clients 1 --verbose --tls --config server-threads 3 + ./runtest --verbose --tls - name: cluster-test run: | - ./runtest-cluster --tls --config server-threads 3 + ./runtest-cluster --tls - name: sentinel test run: | ./runtest-sentinel From f79ae230943e82409d7f0fe5a41ee2e98830514b Mon Sep 17 00:00:00 2001 From: Malavan Sotheeswaran Date: Wed, 4 Jan 2023 19:36:38 -0800 Subject: [PATCH 4/8] ci clients 1 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 972ac36b5..876602336 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: - name: test-tls run: | sudo apt-get -y install tcl tcl-tls - ./runtest --verbose --tls + ./runtest --clients 1 --verbose --tls - name: cluster-test run: | ./runtest-cluster --tls From 7886f673e62476ed8fc3573b676893081fcff520 Mon Sep 17 00:00:00 2001 From: Malavan Sotheeswaran Date: Thu, 5 Jan 2023 00:16:06 -0800 Subject: [PATCH 5/8] undo changes with no effect --- src/cluster.cpp | 4 ++-- tests/cluster/tests/includes/init-tests.tcl | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/cluster.cpp b/src/cluster.cpp index 50a5a9423..7f6d897c9 100644 --- a/src/cluster.cpp +++ b/src/cluster.cpp @@ -2629,9 +2629,9 @@ void clusterSendPing(clusterLink *link, int type) { * Since we have non-voting slaves that lower the probability of an entry * to feature our node, we set the number of entries per packet as * 10% of the total nodes we have. */ - wanted = floor(dictSize(g_pserver->cluster->nodes)); + wanted = floor(dictSize(g_pserver->cluster->nodes)/10); if (wanted < 3) wanted = 3; - //if (wanted > freshnodes) wanted = freshnodes; + if (wanted > freshnodes) wanted = freshnodes; /* Include all the nodes in PFAIL state, so that failure reports are * faster to propagate to go from PFAIL to FAIL state. */ diff --git a/tests/cluster/tests/includes/init-tests.tcl b/tests/cluster/tests/includes/init-tests.tcl index 1f7ec8d57..466ab8f25 100644 --- a/tests/cluster/tests/includes/init-tests.tcl +++ b/tests/cluster/tests/includes/init-tests.tcl @@ -26,7 +26,6 @@ test "Cluster nodes are reachable" { } test "Cluster nodes hard reset" { - after 60000 foreach_redis_id id { if {$::valgrind} { set node_timeout 10000 From f59bafb9a958363f574718c744186a02d1a513ec Mon Sep 17 00:00:00 2001 From: Malavan Sotheeswaran Date: Thu, 5 Jan 2023 00:45:55 -0800 Subject: [PATCH 6/8] cluster test uses 3 threads by default, try 1 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 876602336..3e1446a46 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: ./runtest --clients 1 --verbose --tls - name: cluster-test run: | - ./runtest-cluster --tls + ./runtest-cluster --tls --config server-threads 1 - name: sentinel test run: | ./runtest-sentinel From 2cfd229ec47a89d9ff6ac4525f0bb9eba6144da2 Mon Sep 17 00:00:00 2001 From: Malavan Sotheeswaran Date: Thu, 5 Jan 2023 09:06:03 -0800 Subject: [PATCH 7/8] delay is needed --- tests/cluster/tests/includes/init-tests.tcl | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/cluster/tests/includes/init-tests.tcl b/tests/cluster/tests/includes/init-tests.tcl index 466ab8f25..1f7ec8d57 100644 --- a/tests/cluster/tests/includes/init-tests.tcl +++ b/tests/cluster/tests/includes/init-tests.tcl @@ -26,6 +26,7 @@ test "Cluster nodes are reachable" { } test "Cluster nodes hard reset" { + after 60000 foreach_redis_id id { if {$::valgrind} { set node_timeout 10000 From f596fe85d2e3f907c496a673cf8b6126b42b1b14 Mon Sep 17 00:00:00 2001 From: Malavan Sotheeswaran Date: Thu, 5 Jan 2023 15:10:08 -0800 Subject: [PATCH 8/8] 10 instances instead of 20 for cluster tests --- tests/cluster/run.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cluster/run.tcl b/tests/cluster/run.tcl index 7e1e91081..8a85e7ecb 100644 --- a/tests/cluster/run.tcl +++ b/tests/cluster/run.tcl @@ -7,7 +7,7 @@ source cluster.tcl source ../instances.tcl source ../../support/cluster.tcl ; # Redis Cluster client. -set ::instances_count 20 ; # How many instances we use at max. +set ::instances_count 10 ; # How many instances we use at max. set ::tlsdir "../../tls" proc main {} {