[SCM] CTDB repository - branch 2.5 updated - ctdb-2.5.3-86-g99ce67c
Amitay Isaacs
amitay at samba.org
Thu Jul 10 00:48:48 MDT 2014
The branch, 2.5 has been updated
via 99ce67c7caa78baaa48fdd43919ab8e03207e1e9 (commit)
via b9204e1ecf4addfc5b862383e8f85657e10188f7 (commit)
via 549ffce486bbdb6c59c547be2d62cf7595c8fc57 (commit)
via 51376f06cfefcead421227d77df9b45eaaa20054 (commit)
via 418e807b40f35533d3ec19ddfd7261857f76f54f (commit)
from f2dcea106f586c3151584d5bb7ef1cbcaa6dee88 (commit)
http://gitweb.samba.org/?p=ctdb.git;a=shortlog;h=2.5
- Log -----------------------------------------------------------------
commit 99ce67c7caa78baaa48fdd43919ab8e03207e1e9
Author: Amitay Isaacs <amitay at gmail.com>
Date: Mon Nov 11 00:32:31 2013 +1100
daemon: Support per-node robust mutex feature
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 at gmail.com>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
Autobuild-Date(master): Wed Jul 9 06:45:17 CEST 2014 on sn-devel-104
(Imported from commit 55fbe364b93000c7766e95e16fa35cc6a80c697b)
commit b9204e1ecf4addfc5b862383e8f85657e10188f7
Author: Amitay Isaacs <amitay at gmail.com>
Date: Mon Jun 30 15:09:32 2014 +1000
daemon: Enable robust mutexes only if TDB_MUTEX_LOCKING is defined
Runtime check for robust mutexes is performed just before opening local tdb.
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(Imported from commit 2e7b0870ec1014f8320032b86dc54f0a6fd55776)
commit 549ffce486bbdb6c59c547be2d62cf7595c8fc57
Author: Volker Lendecke <vl at samba.org>
Date: Wed Feb 20 15:09:36 2013 +0100
daemon: Allow flag TDB_MUTEX_LOCKING to pass into db_attach
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(Imported from commit 1627171792567fc55290330feaaef9d9efc66c48)
commit 51376f06cfefcead421227d77df9b45eaaa20054
Author: Amitay Isaacs <amitay at gmail.com>
Date: Tue Jun 24 12:04:25 2014 +1000
daemon: Simplify code a bit
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(Imported from commit 91be76dbe93a2be763a93163bec8c17d35057944)
commit 418e807b40f35533d3ec19ddfd7261857f76f54f
Author: Amitay Isaacs <amitay at gmail.com>
Date: Tue Jun 24 11:46:53 2014 +1000
daemon: Use false instead of 0 for boolean arguments
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(Imported from commit 1ed330f7cbd753b6c29246d522c5ddca5160d8bb)
-----------------------------------------------------------------------
Summary of changes:
client/ctdb_client.c | 12 ++++++++++++
include/ctdb_private.h | 1 +
server/ctdb_ltdb_server.c | 25 ++++++++++++++++++++++---
server/ctdb_tunables.c | 1 +
4 files changed, 36 insertions(+), 3 deletions(-)
Changeset truncated at 500 lines:
diff --git a/client/ctdb_client.c b/client/ctdb_client.c
index c8ab1cd..df57302 100644
--- a/client/ctdb_client.c
+++ b/client/ctdb_client.c
@@ -1926,6 +1926,12 @@ int ctdb_ctrl_createdb(struct ctdb_context *ctdb, struct timeval timeout, uint32
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,
@@ -2073,6 +2079,12 @@ struct ctdb_db_context *ctdb_attach(struct ctdb_context *ctdb,
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,
diff --git a/include/ctdb_private.h b/include/ctdb_private.h
index aeebed1..e94d2c8 100644
--- a/include/ctdb_private.h
+++ b/include/ctdb_private.h
@@ -126,6 +126,7 @@ struct ctdb_tunable {
uint32_t pulldb_preallocation_size;
uint32_t no_ip_host_on_all_disabled;
uint32_t samba3_hack;
+ uint32_t mutex_enabled;
};
/*
diff --git a/server/ctdb_ltdb_server.c b/server/ctdb_ltdb_server.c
index 7738f76..55abf1f 100644
--- a/server/ctdb_ltdb_server.c
+++ b/server/ctdb_ltdb_server.c
@@ -741,7 +741,7 @@ int ctdb_set_db_readonly(struct ctdb_context *ctdb, struct ctdb_db_context *ctdb
*/
static int ctdb_local_attach(struct ctdb_context *ctdb, const char *db_name,
bool persistent, const char *unhealthy_reason,
- bool jenkinshash)
+ bool jenkinshash, bool mutexes)
{
struct ctdb_db_context *ctdb_db, *tmp_db;
int ret;
@@ -836,6 +836,12 @@ static int ctdb_local_attach(struct ctdb_context *ctdb, const char *db_name,
if (jenkinshash) {
tdb_flags |= TDB_INCOMPATIBLE_HASH;
}
+#ifdef TDB_MUTEX_LOCKING
+ if (ctdb->tunable.mutex_enabled && mutexes &&
+ tdb_runtime_check_for_robust_mutexes()) {
+ tdb_flags |= TDB_MUTEX_LOCKING;
+ }
+#endif
again:
ctdb_db->ltdb = tdb_wrap_open(ctdb_db, ctdb_db->db_path,
@@ -1065,6 +1071,7 @@ int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata,
struct ctdb_db_context *db;
struct ctdb_node *node = ctdb->nodes[ctdb->pnn];
struct ctdb_client *client = NULL;
+ bool with_jenkinshash, with_mutexes;
if (ctdb->tunable.allow_client_db_attach == 0) {
DEBUG(DEBUG_ERR, ("DB Attach to database %s denied by tunable "
@@ -1117,7 +1124,11 @@ int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata,
only allow a subset of those on the database in ctdb. Note
that tdb_flags is passed in via the (otherwise unused)
srvid to the attach control */
+#ifdef TDB_MUTEX_LOCKING
+ tdb_flags &= (TDB_NOSYNC|TDB_INCOMPATIBLE_HASH|TDB_MUTEX_LOCKING);
+#else
tdb_flags &= (TDB_NOSYNC|TDB_INCOMPATIBLE_HASH);
+#endif
/* see if we already have this name */
db = ctdb_db_handle(ctdb, db_name);
@@ -1134,7 +1145,15 @@ int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata,
return 0;
}
- if (ctdb_local_attach(ctdb, db_name, persistent, NULL, (tdb_flags&TDB_INCOMPATIBLE_HASH)?true:false) != 0) {
+ with_jenkinshash = (tdb_flags & TDB_INCOMPATIBLE_HASH) ? true : false;
+#ifdef TDB_MUTEX_LOCKING
+ with_mutexes = (tdb_flags & TDB_MUTEX_LOCKING) ? true : false;
+#else
+ with_mutexes = false;
+#endif
+
+ if (ctdb_local_attach(ctdb, db_name, persistent, NULL,
+ with_jenkinshash, with_mutexes) != 0) {
return -1;
}
@@ -1307,7 +1326,7 @@ static int ctdb_attach_persistent(struct ctdb_context *ctdb,
}
p[4] = 0;
- if (ctdb_local_attach(ctdb, s, true, unhealthy_reason, 0) != 0) {
+ if (ctdb_local_attach(ctdb, s, true, unhealthy_reason, false, false) != 0) {
DEBUG(DEBUG_ERR,("Failed to attach to persistent database '%s'\n", de->d_name));
closedir(d);
talloc_free(s);
diff --git a/server/ctdb_tunables.c b/server/ctdb_tunables.c
index f760cb5..4a252b6 100644
--- a/server/ctdb_tunables.c
+++ b/server/ctdb_tunables.c
@@ -82,6 +82,7 @@ static const struct {
{ "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 },
};
/*
--
CTDB repository
More information about the samba-cvs
mailing list