summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronniesahlberg@gmail.com>2012-02-28 06:58:59 +1100
committerRonnie Sahlberg <ronniesahlberg@gmail.com>2012-02-28 06:58:59 +1100
commitf3600276fc1c0403cc79fd8792eae6183ed9e929 (patch)
treea127097abcc0b03d2b0090efe93eda0e730f0088
parentef2bd0b016f4ff9971e93f3e8ff922afccac46b9 (diff)
downloadsamba-f3600276fc1c0403cc79fd8792eae6183ed9e929.tar.gz
samba-f3600276fc1c0403cc79fd8792eae6183ed9e929.tar.xz
samba-f3600276fc1c0403cc79fd8792eae6183ed9e929.zip
Add a tunable variable to control how long we defer after a ctdb addip until we force a rebalance and try to failback addresses onto this node
Have it default to 300 seconds. (This used to be ctdb commit 49791db7dc74cffd7e88bd73091590cdc1909328)
-rw-r--r--ctdb/include/ctdb_private.h1
-rw-r--r--ctdb/server/ctdb_recoverd.c6
-rw-r--r--ctdb/server/ctdb_tunables.c3
3 files changed, 8 insertions, 2 deletions
diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h
index 8e65a8a1ce..303995389f 100644
--- a/ctdb/include/ctdb_private.h
+++ b/ctdb/include/ctdb_private.h
@@ -124,6 +124,7 @@ struct ctdb_tunable {
uint32_t lcp2_public_ip_assignment;
uint32_t allow_client_db_attach;
uint32_t recover_pdb_by_seqnum;
+ uint32_t deferred_rebalance_on_node_add;
};
/*
diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c
index e7f259358c..642679b4ad 100644
--- a/ctdb/server/ctdb_recoverd.c
+++ b/ctdb/server/ctdb_recoverd.c
@@ -2100,6 +2100,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);
@@ -2110,7 +2114,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);
}
diff --git a/ctdb/server/ctdb_tunables.c b/ctdb/server/ctdb_tunables.c
index d7323ec77c..c5e15c1b4a 100644
--- a/ctdb/server/ctdb_tunables.c
+++ b/ctdb/server/ctdb_tunables.c
@@ -72,7 +72,8 @@ static const struct {
{ "StatHistoryInterval", 1, offsetof(struct ctdb_tunable, stat_history_interval), false },
{ "DeferredAttachTO", 120, offsetof(struct ctdb_tunable, deferred_attach_timeout), false },
{ "AllowClientDBAttach", 1, offsetof(struct ctdb_tunable, allow_client_db_attach), false },
- { "RecoverPDBBySeqNum", 0, offsetof(struct ctdb_tunable, recover_pdb_by_seqnum), false }
+ { "RecoverPDBBySeqNum", 0, offsetof(struct ctdb_tunable, recover_pdb_by_seqnum), false },
+ { "DeferredRebalanceOnNodeAdd", 300, offsetof(struct ctdb_tunable, deferred_rebalance_on_node_add) }
};
/*