Use the "database:tdb mutexes" option instead.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
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) },
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,
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);
}
#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);
</para>
</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>
DBRecordSizeWarn = 10000000
DBSizeWarn = 100000000
PullDBPreallocation = 10485760
-TDBMutexEnabled = 1
LockProcessesPerDB = 200
RecBufferSizeLimit = 1000000
QueueBufferSize = 1024
</listitem>
</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>
DATABASE_CONF_SECTION,
DATABASE_CONF_LOCK_DEBUG_SCRIPT,
&ctdb_config.lock_debug_script);
+ conf_assign_boolean_pointer(conf,
+ DATABASE_CONF_SECTION,
+ DATABASE_CONF_TDB_MUTEXES,
+ &ctdb_config.tdb_mutexes);
/*
* Event
const char *dbdir_persistent;
const char *dbdir_state;
const char *lock_debug_script;
+ bool tdb_mutexes;
/* Event */
const char *event_debug_script;
#include "common/common.h"
#include "common/logging.h"
+#include "server/ctdb_config.h"
+
#define PERSISTENT_HEALTH_TDB "persistent_health.tdb"
/**
ctdb->db_directory,
db_name, ctdb->pnn);
- tdb_flags = ctdb_db_tdb_flags(db_flags, ctdb->valgrinding,
- ctdb->tunable.mutex_enabled);
+ tdb_flags = ctdb_db_tdb_flags(db_flags,
+ ctdb->valgrinding,
+ ctdb_config.tdb_mutexes);
again:
ctdb_db->ltdb = tdb_wrap_open(ctdb_db, ctdb_db->db_path,
# persistent database directory = ${database_persistent_dbdir}
# state database directory = ${database_state_dbdir}
# lock debug script =
+ # tdb mutexes = true
[event]
# debug script =
[legacy]
setup_tunable_config <<EOF
MonitorInterval=5
-TDBMutexEnabled=0
EOF
required_result 0 <<EOF
Set MonitorInterval to 5
-Set TDBMutexEnabled to 0
EOF
simple_test
export FAKE_CTDB_TUNABLES_OK="
MonitorInterval
- TDBMutexEnabled
DatabaseHashSize
"
export FAKE_CTDB_TUNABLES_OBSOLETE="
DBRecordSizeWarn = 10000000
DBSizeWarn = 100000000
PullDBPreallocation = 10485760
-TDBMutexEnabled = 1
LockProcessesPerDB = 200
RecBufferSizeLimit = 1000000
QueueBufferSize = 1024