From: Martin Schwenke Date: Mon, 18 Jun 2018 05:01:01 +0000 (+1000) Subject: ctdb-daemon: Change default for tunable NoIPHostOnAllDisabled to 1 X-Git-Tag: tevent-0.9.37~47 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d0739b2ea81140f6514a8a48dd2ce5184f6bdb54;p=thirdparty%2Fsamba.git ctdb-daemon: Change default for tunable NoIPHostOnAllDisabled to 1 Defaulting to host public IP addresses when all nodes are unhealthy does not obey the principle of least surprise. It has caused much confusion over the years. It often leads to problems when all nodes are unhealthy due to something like a cluster filesystem being unmounted. Change the default value for this tunable as the first step of completely removing this behaviour. Remove tests that set NoIPHostOnAllDisabled=1 and update the expected result for other tests where no nodes are healthy. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/common/tunable.c b/ctdb/common/tunable.c index 14f6828bd15..0b6f0266c72 100644 --- a/ctdb/common/tunable.c +++ b/ctdb/common/tunable.c @@ -141,7 +141,7 @@ static struct { offsetof(struct ctdb_tunable_list, db_size_warn) }, { "PullDBPreallocation", 10*1024*1024, false, offsetof(struct ctdb_tunable_list, pulldb_preallocation_size) }, - { "NoIPHostOnAllDisabled", 0, false, + { "NoIPHostOnAllDisabled", 1, false, offsetof(struct ctdb_tunable_list, no_ip_host_on_all_disabled) }, { "Samba3AvoidDeadlocks", 0, true, offsetof(struct ctdb_tunable_list, samba3_hack) }, diff --git a/ctdb/tests/src/ctdb_takeover_tests.c b/ctdb/tests/src/ctdb_takeover_tests.c index aec23c0a551..ead87c758de 100644 --- a/ctdb/tests/src/ctdb_takeover_tests.c +++ b/ctdb/tests/src/ctdb_takeover_tests.c @@ -206,7 +206,7 @@ static void ctdb_test_init(TALLOC_CTX *mem_ctx, if (t != NULL) { noiphostonalldisabled = (uint32_t) strtol(t, NULL, 0); } else { - noiphostonalldisabled = 0; + noiphostonalldisabled = 1; } *ipalloc_state = ipalloc_state_init(mem_ctx, nodemap->num, diff --git a/ctdb/tests/takeover/lcp2.014.sh b/ctdb/tests/takeover/lcp2.014.sh index 0fc7c00fdb0..25482c04607 100755 --- a/ctdb/tests/takeover/lcp2.014.sh +++ b/ctdb/tests/takeover/lcp2.014.sh @@ -7,15 +7,15 @@ define_test "3 nodes, no IPs assigned, all unhealthy" export CTDB_TEST_LOGLEVEL=ERR required_result <3 unhealthy" export CTDB_TEST_LOGLEVEL=ERR required_result <3 unhealthy, NoIPHostOnAllDisabled" - -export CTDB_TEST_LOGLEVEL=ERR -export CTDB_SET_NoIPHostOnAllDisabled=1 - -required_result <3 unhealthy, all IPs assigned, NoIPTakeover" - -export CTDB_TEST_LOGLEVEL=ERR - -# We expect the IPs stay where they are (as opposed to -# NoIPHostOnAllDisabled). IPs are hosted when all nodes are disabled, -# but they have nowhere else to go because of NoIPTakeover. -required_result <3 unhealthy" - -export CTDB_TEST_LOGLEVEL=DEBUG - -required_result < 192.168.21.254 -> 1 [+0] -${TEST_DATE_STAMP} 2 [-58359] -> 192.168.21.252 -> 1 [+0] -${TEST_DATE_STAMP} 2 [-59572] -> 192.168.20.253 -> 1 [+0] -${TEST_DATE_STAMP} 2 [-59823] -> 192.168.20.251 -> 1 [+0] -${TEST_DATE_STAMP} 2 [-59823] -> 192.168.20.249 -> 1 [+0] -${TEST_DATE_STAMP} ---------------------------------------- -${TEST_DATE_STAMP}2 [-59823] -> 192.168.20.251 -> 1 [+0] -${TEST_DATE_STAMP}+++++++++++++++++++++++++++++++++++++++++ -${TEST_DATE_STAMP}Selecting most imbalanced node from: -${TEST_DATE_STAMP} 0 [89609] -${TEST_DATE_STAMP} 1 [0] -${TEST_DATE_STAMP} 2 [88145] -${TEST_DATE_STAMP} ---------------------------------------- -${TEST_DATE_STAMP} CONSIDERING MOVES FROM 0 [89609] -${TEST_DATE_STAMP} 0 [-42483] -> 192.168.21.253 -> 1 [+14161] -${TEST_DATE_STAMP} 0 [-45662] -> 192.168.20.254 -> 1 [+15625] -${TEST_DATE_STAMP} 0 [-45662] -> 192.168.20.252 -> 1 [+15625] -${TEST_DATE_STAMP} 0 [-45411] -> 192.168.20.250 -> 1 [+16129] -${TEST_DATE_STAMP} ---------------------------------------- -${TEST_DATE_STAMP}0 [-45662] -> 192.168.20.254 -> 1 [+15625] -${TEST_DATE_STAMP}+++++++++++++++++++++++++++++++++++++++++ -${TEST_DATE_STAMP}Selecting most imbalanced node from: -${TEST_DATE_STAMP} 0 [43947] -${TEST_DATE_STAMP} 1 [15625] -${TEST_DATE_STAMP} 2 [88145] -${TEST_DATE_STAMP} ---------------------------------------- -${TEST_DATE_STAMP} CONSIDERING MOVES FROM 2 [88145] -${TEST_DATE_STAMP} 2 [-44198] -> 192.168.21.254 -> 1 [+28322] -${TEST_DATE_STAMP} 2 [-44198] -> 192.168.21.252 -> 1 [+28322] -${TEST_DATE_STAMP} 2 [-43947] -> 192.168.20.253 -> 1 [+31501] -${TEST_DATE_STAMP} 2 [-43947] -> 192.168.20.249 -> 1 [+31501] -${TEST_DATE_STAMP} ---------------------------------------- -${TEST_DATE_STAMP}2 [-44198] -> 192.168.21.254 -> 1 [+28322] -${TEST_DATE_STAMP}+++++++++++++++++++++++++++++++++++++++++ -${TEST_DATE_STAMP}Selecting most imbalanced node from: -${TEST_DATE_STAMP} 0 [43947] -${TEST_DATE_STAMP} 1 [43947] -${TEST_DATE_STAMP} 2 [43947] -${TEST_DATE_STAMP} ---------------------------------------- -${TEST_DATE_STAMP} CONSIDERING MOVES FROM 0 [43947] -${TEST_DATE_STAMP} 0 [-28322] -> 192.168.21.253 -> 1 [+44198] -${TEST_DATE_STAMP} 0 [-29786] -> 192.168.20.252 -> 1 [+45662] -${TEST_DATE_STAMP} 0 [-29786] -> 192.168.20.250 -> 1 [+45915] -${TEST_DATE_STAMP} ---------------------------------------- -${TEST_DATE_STAMP} ---------------------------------------- -${TEST_DATE_STAMP} CONSIDERING MOVES FROM 1 [43947] -${TEST_DATE_STAMP} 1 [-28322] -> 192.168.21.254 -> 1 [+28322] -${TEST_DATE_STAMP} 1 [-29786] -> 192.168.20.254 -> 1 [+29786] -${TEST_DATE_STAMP} 1 [-29786] -> 192.168.20.251 -> 1 [+29786] -${TEST_DATE_STAMP} ---------------------------------------- -${TEST_DATE_STAMP} ---------------------------------------- -${TEST_DATE_STAMP} CONSIDERING MOVES FROM 2 [43947] -${TEST_DATE_STAMP} 2 [-28322] -> 192.168.21.252 -> 1 [+44198] -${TEST_DATE_STAMP} 2 [-29786] -> 192.168.20.253 -> 1 [+45662] -${TEST_DATE_STAMP} 2 [-29786] -> 192.168.20.249 -> 1 [+45662] -${TEST_DATE_STAMP} ---------------------------------------- -192.168.21.254 1 -192.168.21.253 0 -192.168.21.252 2 -192.168.20.254 1 -192.168.20.253 2 -192.168.20.252 0 -192.168.20.251 1 -192.168.20.250 0 -192.168.20.249 2 -EOF - -simple_test 2,2,2 <