[SCM] Samba Shared Repository - branch v4-9-test updated
Karolin Seeger
kseeger at samba.org
Tue Aug 28 12:10:02 UTC 2018
The branch, v4-9-test has been updated
via 927c199 WHATSNEW: More CTDB updates for 4.9
via e67b397 ctdb-tests: Check that no IPs are assigned when failover is disabled
via 6620173 ctdb-tests: Add an extra conf loading test case
via 512149a ctdb-doc: Switch tunable DisableIPFailover to a config option
via 79a3bef ctdb-config: Switch tunable DisableIPFailover to a config option
via 83b79f5 ctdb-config: Integrate failover options into conf-tool
via f518865 ctdb-failover: Add failover configuration options
via 4a30fb0 ctdb-tests: Drop DisableIPFailover simple test
via 089d3b9 ctdb-daemon: Pass DisableIPFailover tunable via environment variable
via 624b4d1 ctdb-common: Allow boolean configuration values to have yes/no values
via 5567445 ctdb-doc: Switch tunable TDBMutexEnabled to a config option
via 75261d6 ctdb-config: Switch tunable TDBMutexEnabled to a config option
via 5f346ce ctdb-doc: Add support for migrating tunables to ctdb.conf options
via 73c884c ctdb-doc: Change option "no realtime" option to "realtime scheduling"
via d51434b ctdb-config: Change option "no realtime" option to "realtime scheduling"
via 34b4bdc ctdb-doc: Handle boolean options in config migration more carefully
via 97048c0 ctdb-doc: Make config migration script notice removed CTDB_BASE option
via 7e38e95 ctdb-common: Fix aliasing issue in IPv6 checksum
via 3fd839a s3: smbd: Ensure get_real_filename() copes with empty pathnames.
from 729ac56 torture: Demonstrate the invalid lock order panic
https://git.samba.org/?p=samba.git;a=shortlog;h=v4-9-test
- Log -----------------------------------------------------------------
commit 927c199630b41b932009656ce146f404b8f2ea5d
Author: Martin Schwenke <martin at meltin.net>
Date: Sun Aug 26 20:28:39 2018 +1000
WHATSNEW: More CTDB updates for 4.9
This includes descriptions of some final configuration changes as well
as an overall mapping between old and new configuration options.
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
Autobuild-User(v4-9-test): Karolin Seeger <kseeger at samba.org>
Autobuild-Date(v4-9-test): Tue Aug 28 14:08:58 CEST 2018 on sn-devel-144
commit e67b397f85c624b0eaf5e5161337c58ce858d639
Author: Martin Schwenke <martin at meltin.net>
Date: Fri Aug 24 17:37:38 2018 +1000
ctdb-tests: Check that no IPs are assigned when failover is disabled
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
Autobuild-Date(master): Fri Aug 24 14:13:12 CEST 2018 on sn-devel-144
(cherry picked from commit 6fb80cbffb9cb8cba6abc3fbce228811d36e8c9a)
commit 6620173e7f1fab76199fb970ca85ed246a7fb15b
Author: Martin Schwenke <martin at meltin.net>
Date: Tue Aug 21 06:55:33 2018 +1000
ctdb-tests: Add an extra conf loading test case
This shows that config file loading continues in spite of unknown keys
if ignore_unknown is true.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 55893bf8d2cc7e01b3a93d8e1fde16408244cb65)
commit 512149a8f44c305054573a6772f84165d16862ae
Author: Martin Schwenke <martin at meltin.net>
Date: Tue Aug 21 17:25:53 2018 +1000
ctdb-doc: Switch tunable DisableIPFailover to a config option
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 78aad7623e100f05a7dfc142fba7ff2b0eba1913)
commit 79a3befc052d0da27e7ef21e6366758f65121007
Author: Martin Schwenke <martin at meltin.net>
Date: Tue Aug 21 13:41:22 2018 +1000
ctdb-config: Switch tunable DisableIPFailover to a config option
Use the "failover:disabled" option instead.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 929634126a334e380f16c080b59d062873b4e5f9)
commit 83b79f5bfb5af906f23ca81e13e4d3682e6a3a58
Author: Martin Schwenke <martin at meltin.net>
Date: Tue Aug 21 11:44:03 2018 +1000
ctdb-config: Integrate failover options into conf-tool
Update and add tests accordingly.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit d003a41a9cb9ea97a7da9dbb5bd3138f82da6cf1)
commit f518865e97722737b988e6e56ac72a04cdcd7464
Author: Martin Schwenke <martin at meltin.net>
Date: Tue Aug 21 11:30:39 2018 +1000
ctdb-failover: Add failover configuration options
Only a "disabled" option for now. Not documented because it isn't
used yet.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 893dd623dfdec4d5c5da07f933069e4534fe58ae)
commit 4a30fb0a1a5ed28ca9c864ff34310537cd5d879e
Author: Martin Schwenke <martin at meltin.net>
Date: Tue Aug 21 11:18:34 2018 +1000
ctdb-tests: Drop DisableIPFailover simple test
This is about to become a config file option that can't be dynamically
changed at run-time, so drop this test for now. This test will be added
once the tunable becomes a config file option.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 8e160d331aaccd64b1a767c0bde9e310c80afe06)
commit 089d3b900f22265ba31041b07902f95021b4faf1
Author: Martin Schwenke <martin at meltin.net>
Date: Tue Aug 21 09:36:00 2018 +1000
ctdb-daemon: Pass DisableIPFailover tunable via environment variable
Preparation for obsoleting this tunable.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 914e9f22d85b9274871b7c7d5486354928080e51)
commit 624b4d15577daf68976cf3674699a948da969ea8
Author: Martin Schwenke <martin at meltin.net>
Date: Mon Aug 20 13:43:38 2018 +1000
ctdb-common: Allow boolean configuration values to have yes/no values
This make the new configuration style more consistent with the old one.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 21de59ab7fe53240380b9a9a5b32d5af32d34237)
commit 55674458d245314b458e30449972ec3821ddd1d1
Author: Martin Schwenke <martin at meltin.net>
Date: Tue Aug 21 13:51:40 2018 +1000
ctdb-doc: Switch tunable TDBMutexEnabled to a config option
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit a9758f413d06b0d114f4e5a0e053bbc8956c60b7)
commit 75261d6a6d324f5424df7810268b633531b7e72d
Author: Martin Schwenke <martin at meltin.net>
Date: Mon Aug 20 15:01:50 2018 +1000
ctdb-config: Switch tunable TDBMutexEnabled to a config option
Use the "database:tdb mutexes" option instead.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit f42486e8912eee45eb75d27b753bb74c3b37d80b)
commit 5f346ce08db333d35b5dc18725fe976eb5cac8c7
Author: Martin Schwenke <martin at meltin.net>
Date: Mon Aug 20 19:09:45 2018 +1000
ctdb-doc: Add support for migrating tunables to ctdb.conf options
This will become common, so will be useful to have support for.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 8ddfc26d79fda2fd0265f370a4c08dc584e6a6ac)
commit 73c884c5daf0ad6a715d4e3f1849efe05973eace
Author: Martin Schwenke <martin at meltin.net>
Date: Tue Aug 21 13:45:32 2018 +1000
ctdb-doc: Change option "no realtime" option to "realtime scheduling"
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 43adcd717cee689c2d0386bd2aa2878006aa9217)
commit d51434b59e0fca75c51338178df47279cca93a4c
Author: Martin Schwenke <martin at meltin.net>
Date: Mon Aug 20 13:35:33 2018 +1000
ctdb-config: Change option "no realtime" option to "realtime scheduling"
Negative options can be confusing, so switch to a positive option.
This was supposed to be done months ago but was forgotten.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 17068e756b9e46f7a6c77d533ef1777173bb3795)
commit 34b4bdcf81c35be999c7f469f605b0c7cf76444c
Author: Martin Schwenke <martin at meltin.net>
Date: Mon Aug 20 13:29:52 2018 +1000
ctdb-doc: Handle boolean options in config migration more carefully
Values for ctdb.conf options are now returned by
get_ctdb_conf_option(). The main goal is to allow old boolean options
to be replaced by new logically negated options.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 64d4a7ae5ac3aed2b1b9e7ab85c372e6900826ac)
commit 97048c0c856911b897679030afd757e2c14a5b46
Author: Martin Schwenke <martin at meltin.net>
Date: Mon Aug 20 13:38:25 2018 +1000
ctdb-doc: Make config migration script notice removed CTDB_BASE option
This should never have been a user-level option, but some people used
it.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit d4afb60a24b932a0b7a0c2f27526f41d0bf38fc2)
commit 7e38e9503a28c6bf6314f84b28d89a15d23e524d
Author: Martin Schwenke <martin at meltin.net>
Date: Mon Aug 13 12:18:51 2018 +1000
ctdb-common: Fix aliasing issue in IPv6 checksum
Since commit 9c51b278b1700cd5f3e2addc19b7c711cc2ea10b the compiler has
been able to inline the affected call to uint16_checksum(). Given
that the data (phdr) is being accessed by an incompatible
pointer (data) there is an aliasing problem when the call is inlined.
This results in incorrect behaviour with -O2/-O3 when compiling with
at least GCC 6, 7, and 8.
Fix this by making the types compatible.
Also fixes CID 1437604 (Reliance on integer endianness). This is a
false positive because the uint16_checksum doesn't depend on the order
of the input uint16_t items.
https://bugzilla.samba.org/show_bug.cgi?id=13588
Pair-programmed-with: Amitay Isaacs <amitay at gmail.com>
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 48335725deecdbdb24a9176cf31e9611c9deda49)
commit 3fd839aeba4ab5fe70837c16ff5320c0e1d132fa
Author: Jeremy Allison <jra at samba.org>
Date: Tue Aug 21 12:05:34 2018 -0700
s3: smbd: Ensure get_real_filename() copes with empty pathnames.
Needed for vfs_glusterfs, as Gluster requires "." not '\0'.
Based on a fix from Anoop C S <anoopcs at redhat.com>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13585
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Ira Cooper <ira at samba.org>
Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Wed Aug 22 21:50:41 CEST 2018 on sn-devel-144
(cherry picked from commit 9c71f61ed8a31d287d343d4f2e68cb40c57a2b89)
-----------------------------------------------------------------------
Summary of changes:
WHATSNEW.txt | 25 +++++
ctdb/common/conf.c | 4 +-
ctdb/common/conf_tool.c | 2 +
ctdb/common/system_socket.c | 12 ++-
ctdb/common/tunable.c | 4 +-
ctdb/database/database_conf.c | 21 +++++
ctdb/database/database_conf.h | 3 +-
ctdb/doc/ctdb-tunables.7.xml | 28 ------
ctdb/doc/ctdb.1.xml | 2 -
ctdb/doc/ctdb.conf.5.xml | 52 ++++++++++-
ctdb/doc/examples/config_migrate.sh | 104 +++++++++++++++------
ctdb/doc/examples/config_migrate.test_input | 7 +-
.../database_conf.h => failover/failover_conf.c} | 43 ++++++---
.../event_conf.h => failover/failover_conf.h} | 16 ++--
ctdb/server/ctdb_config.c | 18 +++-
ctdb/server/ctdb_config.h | 6 +-
ctdb/server/ctdb_ltdb_server.c | 7 +-
ctdb/server/ctdb_recoverd.c | 14 ++-
ctdb/server/ctdb_takeover.c | 10 +-
ctdb/server/ctdb_takeover_helper.c | 4 +-
ctdb/server/ctdbd.c | 2 +-
ctdb/server/legacy_conf.c | 4 +-
ctdb/server/legacy_conf.h | 2 +-
ctdb/tests/cunit/config_test_001.sh | 25 ++++-
ctdb/tests/cunit/config_test_006.sh | 4 +-
ctdb/tests/cunit/config_test_007.sh | 24 +++++
ctdb/tests/eventscripts/00.ctdb.setup.002.sh | 2 -
ctdb/tests/eventscripts/scripts/00.ctdb.sh | 1 -
ctdb/tests/simple/19_ip_takeover_noop.sh | 36 ++++---
ctdb/tests/simple/scripts/local_daemons.bash | 5 +
ctdb/tests/takeover_helper/016.sh | 4 +-
ctdb/tests/tool/ctdb.listvars.001.sh | 2 -
ctdb/wscript | 6 ++
source3/smbd/filename.c | 5 +
34 files changed, 370 insertions(+), 134 deletions(-)
copy ctdb/{database/database_conf.h => failover/failover_conf.c} (53%)
copy ctdb/{event/event_conf.h => failover/failover_conf.h} (68%)
create mode 100755 ctdb/tests/cunit/config_test_007.sh
Changeset truncated at 500 lines:
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 97cd50b..47b4262 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -319,6 +319,26 @@ There are many changes to CTDB in this release.
When writing tests there are still mechanisms available to change
the locations of certain directories and files.
+* The following ctdbd.conf and ctdbd options have been replaced by new
+ ctdb.conf options:
+
+ CTDB_LOGGING/--logging logging -> location
+ CTDB_DEBUGLEVEL/-d logging -> log level
+ CTDB_TRANSPORT/--transport cluster -> transport
+ CTDB_NODE_ADDRESS/--listen cluster -> node address
+ CTDB_RECOVERY_LOCK/--reclock cluster -> recovery lock
+ CTDB_DBDIR/--dbdir database -> volatile database directory
+ CTDB_DBDIR_PERSISTENT/--dbdir-persistent database -> peristent database directory
+ CTDB_DBDIR_STATE/--dbdir-state database -> state database directory
+ CTDB_DEBUG_LOCKS database -> lock debug script
+ CTDB_DEBUG_HUNG_SCRIPT event -> debug script
+ CTDB_NOSETSCHED/--nosetsched legacy -> realtime scheduling
+ CTDB_CAPABILITY_RECMASTER/--no-recmaster legacy -> recmaster capability
+ CTDB_CAPABILITY_LMASTER/--no-lmaster legacy -> lmaster capability
+ CTDB_START_AS_STOPPED/--start-as-stopped legacy -> start as stopped
+ CTDB_START_AS_DISABLED/--start-as-disabled legacy -> start as disabled
+ CTDB_SCRIPT_LOG_LEVEL/--script-log-level legacy -> script log level
+
* Event scripts have moved to the scripts/legacy subdirectory of the
configuration directory
@@ -370,6 +390,11 @@ There are many changes to CTDB in this release.
manually mounted on the directory pointed to by the "volatile
database directory" option. See ctdb.conf(5) for more details.
+* The following tunable options are now ctdb.conf options:
+
+ DisabledIPFailover failover -> disabled
+ TDBMutexEnabled database -> tdb mutexes
+
* Support for the NoIPHostOnAllDisabled tunable has been removed
If all nodes are unhealthy or disabled then CTDB will not host
diff --git a/ctdb/common/conf.c b/ctdb/common/conf.c
index 74af7f8..669ac23 100644
--- a/ctdb/common/conf.c
+++ b/ctdb/common/conf.c
@@ -122,12 +122,12 @@ static int string_to_integer(const char *str, int *int_val)
static int string_to_boolean(const char *str, bool *bool_val)
{
- if (strcasecmp(str, "true") == 0) {
+ if (strcasecmp(str, "true") == 0 || strcasecmp(str, "yes") == 0) {
*bool_val = true;
return 0;
}
- if (strcasecmp(str, "false") == 0) {
+ if (strcasecmp(str, "false") == 0 || strcasecmp(str, "no") == 0) {
*bool_val = false;
return 0;
}
diff --git a/ctdb/common/conf_tool.c b/ctdb/common/conf_tool.c
index 329b204..e6020c5 100644
--- a/ctdb/common/conf_tool.c
+++ b/ctdb/common/conf_tool.c
@@ -32,6 +32,7 @@
#include "cluster/cluster_conf.h"
#include "database/database_conf.h"
#include "event/event_conf.h"
+#include "failover/failover_conf.h"
#include "server/legacy_conf.h"
#include "common/conf_tool.h"
@@ -243,6 +244,7 @@ int conf_tool_run(struct conf_tool_context *ctx, int *result)
cluster_conf_init(ctx->conf);
database_conf_init(ctx->conf);
event_conf_init(ctx->conf);
+ failover_conf_init(ctx->conf);
legacy_conf_init(ctx->conf);
if (! conf_valid(ctx->conf)) {
diff --git a/ctdb/common/system_socket.c b/ctdb/common/system_socket.c
index 62cc782..7528679 100644
--- a/ctdb/common/system_socket.c
+++ b/ctdb/common/system_socket.c
@@ -270,16 +270,20 @@ static uint16_t ip_checksum(uint16_t *data, size_t n, struct ip *ip)
static uint16_t ip6_checksum(uint16_t *data, size_t n, struct ip6_hdr *ip6)
{
- uint32_t phdr[2];
+ uint16_t phdr[3];
uint32_t sum = 0;
uint16_t sum2;
+ uint32_t len;
sum += uint16_checksum((uint16_t *)(void *)&ip6->ip6_src, 16);
sum += uint16_checksum((uint16_t *)(void *)&ip6->ip6_dst, 16);
- phdr[0] = htonl(n);
- phdr[1] = htonl(ip6->ip6_nxt);
- sum += uint16_checksum((uint16_t *)phdr, 8);
+ len = htonl(n);
+ phdr[0] = len & UINT16_MAX;
+ phdr[1] = (len >> 16) & UINT16_MAX;
+ /* ip6_nxt is only 8 bits, so fits comfortably into a uint16_t */
+ phdr[2] = htons(ip6->ip6_nxt);
+ sum += uint16_checksum(phdr, sizeof(phdr));
sum += uint16_checksum(data, n);
diff --git a/ctdb/common/tunable.c b/ctdb/common/tunable.c
index 4c1714c..f516d8c 100644
--- a/ctdb/common/tunable.c
+++ b/ctdb/common/tunable.c
@@ -83,7 +83,7 @@ static struct {
offsetof(struct ctdb_tunable_list, reclock_ping_period) },
{ "NoIPFailback", 0, false,
offsetof(struct ctdb_tunable_list, no_ip_failback) },
- { "DisableIPFailover", 0, false,
+ { "DisableIPFailover", 0, true,
offsetof(struct ctdb_tunable_list, disable_ip_failover) },
{ "VerboseMemoryNames", 0, false,
offsetof(struct ctdb_tunable_list, verbose_memory_names) },
@@ -145,7 +145,7 @@ static struct {
offsetof(struct ctdb_tunable_list, no_ip_host_on_all_disabled) },
{ "Samba3AvoidDeadlocks", 0, true,
offsetof(struct ctdb_tunable_list, samba3_hack) },
- { "TDBMutexEnabled", 1, false,
+ { "TDBMutexEnabled", 1, true,
offsetof(struct ctdb_tunable_list, mutex_enabled) },
{ "LockProcessesPerDB", 200, false,
offsetof(struct ctdb_tunable_list, lock_processes_per_db) },
diff --git a/ctdb/database/database_conf.c b/ctdb/database/database_conf.c
index 0333ce0..6bdb372 100644
--- a/ctdb/database/database_conf.c
+++ b/ctdb/database/database_conf.c
@@ -54,6 +54,22 @@ static bool check_static_string_change(const char *key,
return true;
}
+static bool check_static_boolean_change(const char *key,
+ bool old_value,
+ bool new_value,
+ enum conf_update_mode mode)
+{
+ if (mode == CONF_MODE_RELOAD || CONF_MODE_API) {
+ if (old_value != new_value) {
+ D_WARNING("Ignoring update of [%s] -> %s\n",
+ DATABASE_CONF_SECTION,
+ key);
+ }
+ }
+
+ return true;
+}
+
static bool database_conf_validate_lock_debug_script(const char *key,
const char *old_script,
const char *new_script,
@@ -141,4 +157,9 @@ void database_conf_init(struct conf_context *conf)
DATABASE_CONF_LOCK_DEBUG_SCRIPT,
NULL,
database_conf_validate_lock_debug_script);
+ conf_define_boolean(conf,
+ DATABASE_CONF_SECTION,
+ DATABASE_CONF_TDB_MUTEXES,
+ true,
+ check_static_boolean_change);
}
diff --git a/ctdb/database/database_conf.h b/ctdb/database/database_conf.h
index 4891b00..6fa579c 100644
--- a/ctdb/database/database_conf.h
+++ b/ctdb/database/database_conf.h
@@ -27,7 +27,8 @@
#define DATABASE_CONF_VOLATILE_DB_DIR "volatile database directory"
#define DATABASE_CONF_PERSISTENT_DB_DIR "persistent database directory"
#define DATABASE_CONF_STATE_DB_DIR "state database directory"
-#define DATABASE_CONF_LOCK_DEBUG_SCRIPT "lock debug script"
+#define DATABASE_CONF_LOCK_DEBUG_SCRIPT "lock debug script"
+#define DATABASE_CONF_TDB_MUTEXES "tdb mutexes"
void database_conf_init(struct conf_context *conf);
diff --git a/ctdb/doc/ctdb-tunables.7.xml b/ctdb/doc/ctdb-tunables.7.xml
index a925ca5..71cb0e3 100644
--- a/ctdb/doc/ctdb-tunables.7.xml
+++ b/ctdb/doc/ctdb-tunables.7.xml
@@ -178,23 +178,6 @@ MonitorInterval=20
</refsect2>
<refsect2>
- <title>DisableIPFailover</title>
- <para>Default: 0</para>
- <para>
- When set to non-zero, ctdb will not perform failover or
- failback. Even if a node fails while holding public IPs, ctdb
- will not recover the IPs or assign them to another node.
- </para>
- <para>
- When this tunable is enabled, ctdb will no longer attempt
- to recover the cluster by failing IP addresses over to other
- nodes. This leads to a service outage until the administrator
- has manually performed IP failover to replacement nodes using the
- 'ctdb moveip' command.
- </para>
- </refsect2>
-
- <refsect2>
<title>ElectionTimeout</title>
<para>Default: 3</para>
<para>
@@ -661,17 +644,6 @@ MonitorInterval=20
</refsect2>
<refsect2>
- <title>TDBMutexEnabled</title>
- <para>Default: 1</para>
- <para>
- This parameter enables TDB_MUTEX_LOCKING feature on volatile
- databases if the robust mutexes are supported. This optimizes the
- record locking using robust mutexes and is much more efficient
- that using posix locks.
- </para>
- </refsect2>
-
- <refsect2>
<title>TickleUpdateInterval</title>
<para>Default: 20</para>
<para>
diff --git a/ctdb/doc/ctdb.1.xml b/ctdb/doc/ctdb.1.xml
index 5c3ce41..355547a 100644
--- a/ctdb/doc/ctdb.1.xml
+++ b/ctdb/doc/ctdb.1.xml
@@ -800,7 +800,6 @@ DatabaseMaxDead = 5
RerecoveryTimeout = 10
EnableBans = 1
NoIPFailback = 0
-DisableIPFailover = 0
VerboseMemoryNames = 0
RecdPingTimeout = 60
RecdFailCount = 10
@@ -828,7 +827,6 @@ DBRecordCountWarn = 100000
DBRecordSizeWarn = 10000000
DBSizeWarn = 100000000
PullDBPreallocation = 10485760
-TDBMutexEnabled = 1
LockProcessesPerDB = 200
RecBufferSizeLimit = 1000000
QueueBufferSize = 1024
diff --git a/ctdb/doc/ctdb.conf.5.xml b/ctdb/doc/ctdb.conf.5.xml
index bcb67b3..01c09bf 100644
--- a/ctdb/doc/ctdb.conf.5.xml
+++ b/ctdb/doc/ctdb.conf.5.xml
@@ -305,6 +305,23 @@
</varlistentry>
<varlistentry>
+ <term>tdb mutexes = true|false</term>
+ <listitem>
+ <para>
+ This parameter enables TDB_MUTEX_LOCKING feature on
+ volatile databases if the robust mutexes are
+ supported. This optimizes the record locking using robust
+ mutexes and is much more efficient that using posix locks.
+ </para>
+ <para>
+ If robust mutexes are unreliable on the platform being
+ used then they can be disabled by setting this to
+ <literal>false</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term>lock debug script = <parameter>FILENAME</parameter></term>
<listitem>
<para>
@@ -376,6 +393,35 @@
<refsect1>
<title>
+ FAILOVER CONFIGURATION
+ </title>
+
+ <para>
+ Options in this section affect CTDB failover. They are
+ valid within the <emphasis>failover</emphasis> section of file,
+ indicated by <literal>[failover]</literal>.
+ </para>
+
+ <variablelist>
+
+ <varlistentry>
+ <term>disabled = true|false</term>
+ <listitem>
+ <para>
+ If set to <literal>true</literal> then public IP failover
+ is disabled.
+ </para>
+ <para>
+ Default: <literal>false</literal>
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </refsect1>
+
+ <refsect1>
+ <title>
LEGACY CONFIGURATION
</title>
@@ -436,17 +482,17 @@
</varlistentry>
<varlistentry>
- <term>no realtime = true|false</term>
+ <term>realtime scheduling = true|false</term>
<listitem>
<para>
Usually CTDB runs with real-time priority. This helps it
to perform effectively on a busy system, such as when
there are thousands of Samba clients. If you are running
CTDB on a platform that does not support real-time
- priority, you can set this to <literal>true</literal>.
+ priority, you can set this to <literal>false</literal>.
</para>
<para>
- Default: <literal>false</literal>
+ Default: <literal>true</literal>
</para>
</listitem>
</varlistentry>
diff --git a/ctdb/doc/examples/config_migrate.sh b/ctdb/doc/examples/config_migrate.sh
index 8eefd03..8479aeb 100755
--- a/ctdb/doc/examples/config_migrate.sh
+++ b/ctdb/doc/examples/config_migrate.sh
@@ -109,33 +109,44 @@ out_file_remove_if_empty ()
# script
#
-# Convert a ctdbd.conf opt+val into a ctdb.conf section+opt
+# Convert a ctdbd.conf opt+val into a ctdb.conf section+opt+val
#
# If opt is matched and val is empty then output is printed, allowing
# this function to be reused to check if opt is valid.
+#
+# Note that for boolean options, the expected value and the new value
+# form part of the data.
get_ctdb_conf_option ()
{
_opt="$1"
_val="$2"
awk -v opt="${_opt}" -v val="${_val}" \
- '$3 == opt { if (!$4 || !val || val ==$4) { print $1, $2 } }' <<EOF
-cluster node-address CTDB_NODE_ADDRESS
-cluster recovery-lock CTDB_RECOVERY_LOCK
-cluster transport CTDB_TRANSPORT
-database lock-debug-script CTDB_DEBUG_LOCKS
-database persistent-database-directory CTDB_DBDIR_PERSISTENT
-database state-database-directory CTDB_DBDIR_STATE
-database volatile-database-directory CTDB_DBDIR
-event debug-script CTDB_DEBUG_HUNG_SCRIPT
-legacy lmaster-capability CTDB_CAPABILITY_LMASTER no
-legacy no-realtime CTDB_NOSETSCHED yes
-legacy recmaster-capability CTDB_CAPABILITY_RECMASTER no
-legacy script-log-level CTDB_SCRIPT_LOG_LEVEL
-legacy start-as-disabled CTDB_START_AS_DISABLED yes
-legacy start-as-stopped CTDB_START_AS_STOPPED yes
-logging location CTDB_LOGGING
-logging log-level CTDB_DEBUGLEVEL
+ '$3 == opt {
+ if (!$4 || !val || val == $4) {
+ if ($5) {
+ print $1, $2, $5
+ } else {
+ print $1, $2, val
+ }
+ }
+ }' <<EOF
+cluster node-address CTDB_NODE_ADDRESS
+cluster recovery-lock CTDB_RECOVERY_LOCK
+cluster transport CTDB_TRANSPORT
+database lock-debug-script CTDB_DEBUG_LOCKS
+database persistent-database-directory CTDB_DBDIR_PERSISTENT
+database state-database-directory CTDB_DBDIR_STATE
+database volatile-database-directory CTDB_DBDIR
+event debug-script CTDB_DEBUG_HUNG_SCRIPT
+legacy lmaster-capability CTDB_CAPABILITY_LMASTER no false
+legacy realtime-scheduling CTDB_NOSETSCHED yes false
+legacy recmaster-capability CTDB_CAPABILITY_RECMASTER no false
+legacy script-log-level CTDB_SCRIPT_LOG_LEVEL
+legacy start-as-disabled CTDB_START_AS_DISABLED yes true
+legacy start-as-stopped CTDB_START_AS_STOPPED yes true
+logging location CTDB_LOGGING
+logging log-level CTDB_DEBUGLEVEL
EOF
}
@@ -149,12 +160,48 @@ check_ctdb_conf_option ()
[ -n "$_out" ]
}
+# Convert a ctdbd.conf tunable option into a ctdb.conf section+opt
+#
+# The difference between this and get_ctdb_conf_option() is that only
+# the tunable part of the option is passed as opt and it is matched
+# case-insensitively.
+get_ctdb_conf_tunable_option ()
+{
+ _opt="$1"
+ _val="$2"
+
+ awk -v opt="${_opt}" -v val="${_val}" \
+ 'tolower($3) == tolower(opt) {
+ if (!$4 || !val || (val == 0 ? 0 : 1) == $4) {
+ if ($5) {
+ print $1, $2, $5
+ } else {
+ print $1, $2, val
+ }
+ }
+ }' <<EOF
+database tdb-mutexes TDBMutexEnabled 0 false
+failover disabled DisableIPFailover 1 true
+EOF
+
+}
+
+# Check if a tunable will convert to a ctdb.conf option
+check_ctdb_conf_tunable_option ()
+{
+ _opt="$1"
+
+ _out=$(get_ctdb_conf_tunable_option "$_opt" "")
+ [ -n "$_out" ]
+}
+
# Check if an option has been removed
check_removed_option ()
{
_option="$1"
grep -Fqx "$_option" <<EOF
+CTDB_BASE
CTDB_PIDFILE
CTDB_SOCKET
CTDB_EVENT_SCRIPT_DIR
@@ -496,23 +543,25 @@ build_ctdb_conf ()
list_options |
while read -r _opt _val ; do
- _out=$(get_ctdb_conf_option "$_opt" "$_val")
+ case "$_opt" in
+ CTDB_SET_*)
+ _opt="${_opt#CTDB_SET_}"
+ _out=$(get_ctdb_conf_tunable_option "$_opt" "$_val")
+ ;;
+ *)
+ _out=$(get_ctdb_conf_option "$_opt" "$_val")
+ esac
if [ -z "$_out" ] ; then
continue
fi
- # ctdb.conf needs true/false, not yes/no
- case "$_val" in
- yes) _val="true" ;;
- no) _val="false" ;;
- esac
-
# $_out is section and key, replace dashes with spaces
# Intentional word splitting
# shellcheck disable=SC2086
set -- $_out
_section=$(echo "$1" | sed -e 's|-| |g')
_key=$(echo "$2" | sed -e 's|-| |g')
+ _newval="$3"
if ! grep -Fqx "[${_section}]" "$_out_file" ; then
# Add blank line if file is not empty
@@ -525,7 +574,7 @@ build_ctdb_conf ()
# Must escape leading TAB or sed eats it
sed -i -e "/\\[${_section}\\]/a\
-\\ ${_key} = ${_val}
+\\ ${_key} = ${_newval}
" "$_out_file"
done
@@ -556,6 +605,9 @@ build_ctdb_tunables ()
list_tunables |
while read -r _var _val ; do
+ if check_ctdb_conf_tunable_option "$_var" ; then
+ continue
+ fi
--
Samba Shared Repository
More information about the samba-cvs
mailing list