Revert "Dont allow client processes to attach to databases while we are still in...
authorRonnie Sahlberg <sahlberg@lenovo-laptop.(none)>
Thu, 17 Feb 2011 20:39:14 +0000 (07:39 +1100)
committerRonnie Sahlberg <sahlberg@lenovo-laptop.(none)>
Thu, 17 Feb 2011 20:39:14 +0000 (07:39 +1100)
This reverts commit faf3b1542fd27b3ad32ac7b362ef39d8cb0b05ff.

git pull ... 1.2-splitbrain
does not do what I think it does.
Revert patch and pull it into the right branch instead.

include/ctdb_private.h
server/ctdb_control.c
server/ctdb_ltdb_server.c

index 5a1c15b1827419dfd19b3dbd8d7f8f172fbe6512..4dcf9a5bf9736d9f4b25b7fc24a07a97f7fa8049 100644 (file)
@@ -799,7 +799,7 @@ int ctdb_daemon_send_control(struct ctdb_context *ctdb, uint32_t destnode,
                             void *private_data);
 
 int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata, 
-                              TDB_DATA *outdata, uint64_t tdb_flags, bool persistent, uint32_t client_id);
+                              TDB_DATA *outdata, uint64_t tdb_flags, bool persistent);
 
 int ctdb_daemon_set_call(struct ctdb_context *ctdb, uint32_t db_id,
                         ctdb_fn_t fn, int id);
index 488b3e9940e0e5df20b6181c88912ad6535b38da..90900c94b1d5a409e1c01350b0c11a10e8be85c0 100644 (file)
@@ -221,10 +221,10 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
        }
 
        case CTDB_CONTROL_DB_ATTACH:
-               return ctdb_control_db_attach(ctdb, indata, outdata, srvid, false, client_id);
+               return ctdb_control_db_attach(ctdb, indata, outdata, srvid, false);
 
        case CTDB_CONTROL_DB_ATTACH_PERSISTENT:
-               return ctdb_control_db_attach(ctdb, indata, outdata, srvid, true, client_id);
+               return ctdb_control_db_attach(ctdb, indata, outdata, srvid, true);
 
        case CTDB_CONTROL_SET_CALL: {
                struct ctdb_control_set_call *sc = 
index 8340c37fbdef9ed0bd693d0b38ce859a3d7d0c87..ba2a9cb475c484cb68f1026b9538c0adb3028de4 100644 (file)
@@ -750,27 +750,11 @@ again:
  */
 int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata,
                               TDB_DATA *outdata, uint64_t tdb_flags, 
-                              bool persistent, uint32_t client_id)
+                              bool persistent)
 {
        const char *db_name = (const char *)indata.dptr;
        struct ctdb_db_context *db;
-       struct ctdb_node *node;
-
-       /* dont allow any local clients to attach while we are in recovery mode
-        * except for the recovery daemon.
-        * allow all attach from the network since these are always from remote
-        * recovery daemons.
-        */
-       if (ctdb->recovery_mode == CTDB_RECOVERY_ACTIVE && client_id != 0) {
-               struct ctdb_client *client = ctdb_reqid_find(ctdb, client_id, struct ctdb_client);
-
-               if (client != NULL && client->pid != ctdb->recoverd_pid) {
-                       DEBUG(DEBUG_ERR,("DB Attach to database %s refused for client with pid:%d since node is in recovery mode.\n", db_name, client->pid));
-                       return -1;
-               }
-       }
-
-       node = ctdb->nodes[ctdb->pnn];
+       struct ctdb_node *node = ctdb->nodes[ctdb->pnn];
 
        /* the client can optionally pass additional tdb flags, but we
           only allow a subset of those on the database in ctdb. Note