To enable TDB mutex support, set tunable TDBMutexEnabled=1.
When databases are attached for the first time, attach flags must include
TDB_MUTEX_LOCKING and TDBMutexEnabled must set to enable mutex support.
However, when CTDB attaches databases internally for recovery, it will
enable mutex support if TDBMutexEnabled is set.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Wed Jul 9 06:45:17 CEST 2014 on sn-devel-104
tdb_flags = TDB_INCOMPATIBLE_HASH;
}
+#ifdef TDB_MUTEX_LOCKING
+ if (!persistent && ctdb->tunable.mutex_enabled == 1) {
+ tdb_flags |= TDB_MUTEX_LOCKING;
+ }
+#endif
+
ret = ctdb_control(ctdb, destnode, tdb_flags,
persistent?CTDB_CONTROL_DB_ATTACH_PERSISTENT:CTDB_CONTROL_DB_ATTACH,
0, data,
tdb_flags |= TDB_INCOMPATIBLE_HASH;
}
+#ifdef TDB_MUTEX_LOCKING
+ if (!persistent && ctdb->tunable.mutex_enabled == 1) {
+ tdb_flags |= TDB_MUTEX_LOCKING;
+ }
+#endif
+
/* tell ctdb daemon to attach */
ret = ctdb_control(ctdb, CTDB_CURRENT_NODE, tdb_flags,
persistent?CTDB_CONTROL_DB_ATTACH_PERSISTENT:CTDB_CONTROL_DB_ATTACH,
uint32_t pulldb_preallocation_size;
uint32_t no_ip_host_on_all_disabled;
uint32_t samba3_hack;
+ uint32_t mutex_enabled;
};
/*
tdb_flags |= TDB_INCOMPATIBLE_HASH;
}
#ifdef TDB_MUTEX_LOCKING
- if (mutexes && tdb_runtime_check_for_robust_mutexes()) {
+ if (ctdb->tunable.mutex_enabled && mutexes &&
+ tdb_runtime_check_for_robust_mutexes()) {
tdb_flags |= TDB_MUTEX_LOCKING;
}
#endif
{ "PullDBPreallocation", 10*1024*1024, offsetof(struct ctdb_tunable, pulldb_preallocation_size), false },
{ "NoIPHostOnAllDisabled", 0, offsetof(struct ctdb_tunable, no_ip_host_on_all_disabled), false },
{ "Samba3AvoidDeadlocks", 0, offsetof(struct ctdb_tunable, samba3_hack), false },
+ { "TDBMutexEnabled", 0, offsetof(struct ctdb_tunable, mutex_enabled), false },
};
/*