summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronniesahlberg@gmail.com>2011-02-25 10:33:12 +1100
committerRonnie Sahlberg <ronniesahlberg@gmail.com>2011-03-01 12:13:46 +1100
commitb611de93ad1af694b5cc36abee62781f7935c51e (patch)
treea1f1f451b51bc465daef5a06353aba5fdfb05129
parent8acb677c9c225e69cad9343d62394814798a47cb (diff)
downloadsamba-b611de93ad1af694b5cc36abee62781f7935c51e.tar.gz
samba-b611de93ad1af694b5cc36abee62781f7935c51e.tar.xz
samba-b611de93ad1af694b5cc36abee62781f7935c51e.zip
ATTACH_DB: simplify the code slightly and change the semantics to only
refuse a db attach during recovery IF we can associate the request from a genuine real client instead of deciding this on whether client_id is zero or This will suppress/avoid messages like these : DB Attach to database %s refused. Can not match clientid... (This used to be ctdb commit b05ccf366df985e0a3365aacc75761ebd438deaf)
-rw-r--r--ctdb/server/ctdb_ltdb_server.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/ctdb/server/ctdb_ltdb_server.c b/ctdb/server/ctdb_ltdb_server.c
index 07fdec0d44..19a68ec745 100644
--- a/ctdb/server/ctdb_ltdb_server.c
+++ b/ctdb/server/ctdb_ltdb_server.c
@@ -805,6 +805,7 @@ int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata,
const char *db_name = (const char *)indata.dptr;
struct ctdb_db_context *db;
struct ctdb_node *node = ctdb->nodes[ctdb->pnn];
+ struct ctdb_client *client = NULL;
/* dont allow any local clients to attach while we are in recovery mode
* except for the recovery daemon.
@@ -812,13 +813,9 @@ int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata,
* recovery daemons.
*/
if (client_id != 0) {
- struct ctdb_client *client = ctdb_reqid_find(ctdb, client_id, struct ctdb_client);
-
- if (client == NULL) {
- DEBUG(DEBUG_ERR,("DB Attach to database %s refused. Can not match clientid:%d to a client structure.\n", db_name, client_id));
- return -1;
- }
-
+ client = ctdb_reqid_find(ctdb, client_id, struct ctdb_client);
+ }
+ if (client != NULL) {
/* If the node is inactive it is not part of the cluster
and we should not allow clients to attach to any
databases