Add a tunable variable to control how long we defer after a ctdb addip until we force...
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Mon, 27 Feb 2012 19:44:08 +0000 (06:44 +1100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Mon, 27 Feb 2012 19:44:08 +0000 (06:44 +1100)
include/ctdb_private.h
server/ctdb_recoverd.c
server/ctdb_tunables.c

index e1237b3f97b09faae29a964e586dc964c8bf8dc5..b490b4db0cd342908f06016f2aa867fc300439ff 100644 (file)
@@ -122,6 +122,7 @@ struct ctdb_tunable {
        uint32_t vacuum_fast_path_count;
        uint32_t lcp2_public_ip_assignment;
        uint32_t allow_client_db_attach;
+       uint32_t deferred_rebalance_on_node_add;
 };
 
 /*
index d3678718f5f6dede4fe511c449156af88113e959..d206d3d2d5c6efd44b1b6463a239b6d05afd1a4d 100644 (file)
@@ -1973,6 +1973,10 @@ static void recd_node_rebalance_handler(struct ctdb_context *ctdb, uint64_t srvi
                return;
        }
 
+       if (ctdb->tunable.deferred_rebalance_on_node_add == 0) {
+               return;
+       }
+
        pnn = *(uint32_t *)&data.dptr[0];
 
        lcp2_forcerebalance(ctdb, pnn);
@@ -1983,7 +1987,7 @@ static void recd_node_rebalance_handler(struct ctdb_context *ctdb, uint64_t srvi
        }
        rec->deferred_rebalance_ctx = talloc_new(rec);
        event_add_timed(ctdb->ev, rec->deferred_rebalance_ctx, 
-                       timeval_current_ofs(60, 0),
+                       timeval_current_ofs(ctdb->tunable.deferred_rebalance_on_node_add, 0),
                        ctdb_rebalance_timeout, rec);
 }
 
index ef86051cecf2ebd634dfa30b5c4d28dca4d9b1f3..eb90f5194b3525eac2ea3b02047e2a8e5117d2b5 100644 (file)
@@ -69,7 +69,8 @@ static const struct {
        { "AllowUnhealthyDBRead", 0,  offsetof(struct ctdb_tunable, allow_unhealthy_db_read) },
        { "StatHistoryInterval",  1,  offsetof(struct ctdb_tunable, stat_history_interval) },
        { "DeferredAttachTO",  120,  offsetof(struct ctdb_tunable, deferred_attach_timeout) },
-       { "AllowClientDBAttach", 1, offsetof(struct ctdb_tunable, allow_client_db_attach) }
+       { "AllowClientDBAttach", 1, offsetof(struct ctdb_tunable, allow_client_db_attach) },
+       { "DeferredRebalanceOnNodeAdd", 300, offsetof(struct ctdb_tunable, deferred_rebalance_on_node_add) }
 };
 
 /*