ctdb-daemon: Don't delay reloading the nodes file
authorMartin Schwenke <martin@meltin.net>
Tue, 10 Feb 2015 04:43:03 +0000 (15:43 +1100)
committerAmitay Isaacs <amitay@samba.org>
Tue, 7 Apr 2015 05:43:13 +0000 (07:43 +0200)
Presumably this was done to minimise the chance of a recovery
occurring while the nodemaps are inconsistent across nodes.

Another potential theory is that the forced recovery in the
ctdb.c:control_reload_nodes_file() stops another recovery occurring
for ReRecoveryTimeout seconds, so this delay causes the reloads to
occur during that period.

This is no longer necessary because recoveries are now explicitly
disabled while node files are reloaded.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ctdb_recover.c

index eb3f46da52ce2658b4c637838efa16da84d15352..b8a9f3353e6846353517d656aacd9d51bd79f43b 100644 (file)
@@ -177,14 +177,15 @@ ctdb_control_getnodemapv4(struct ctdb_context *ctdb, uint32_t opcode, TDB_DATA i
        return 0;
 }
 
-static void
-ctdb_reload_nodes_event(struct event_context *ev, struct timed_event *te, 
-                              struct timeval t, void *private_data)
+/*
+  reload the nodes file
+*/
+int
+ctdb_control_reload_nodes_file(struct ctdb_context *ctdb, uint32_t opcode)
 {
        int i, num_nodes;
-       struct ctdb_context *ctdb = talloc_get_type(private_data, struct ctdb_context);
        TALLOC_CTX *tmp_ctx;
-       struct ctdb_node **nodes;       
+       struct ctdb_node **nodes;
 
        tmp_ctx = talloc_new(ctdb);
 
@@ -225,17 +226,6 @@ ctdb_reload_nodes_event(struct event_context *ev, struct timed_event *te,
        ctdb_daemon_send_message(ctdb, ctdb->pnn, CTDB_SRVID_RELOAD_NODES, tdb_null);
 
        talloc_free(tmp_ctx);
-       return;
-}
-
-/*
-  reload the nodes file after a short delay (so that we can send the response
-  back first
-*/
-int 
-ctdb_control_reload_nodes_file(struct ctdb_context *ctdb, uint32_t opcode)
-{
-       event_add_timed(ctdb->ev, ctdb, timeval_current_ofs(1,0), ctdb_reload_nodes_event, ctdb);
 
        return 0;
 }