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:54 +0000 (06:44 +1100)
include/ctdb_private.h
server/ctdb_recoverd.c
server/ctdb_tunables.c

index 74625dacbd3905e54671ecb41963cd37c65e71f9..7d0a6d8bcfb2c6af2a6fa920c9e0db6513f77b7c 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 47c4ea1ec712837f115e97d8bdd23502880a284f..bf1908920f6382d9f4911e53777a989c6c3294ca 100644 (file)
@@ -1974,6 +1974,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);
@@ -1984,7 +1988,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) }
 };
 
 /*