diff options
| author | Martin Schwenke <martin@meltin.net> | 2013-09-03 11:20:01 +1000 |
|---|---|---|
| committer | Amitay Isaacs <amitay@gmail.com> | 2013-09-19 12:54:30 +1000 |
| commit | bbbb55eef959cba2cf25c0fc89d770530217434c (patch) | |
| tree | 64ca39f65377a6f053c6ac97a65119567d32e241 /ctdb | |
| parent | a1f915f6b524af467cf22e195286b6b4f0c93685 (diff) | |
| download | samba-bbbb55eef959cba2cf25c0fc89d770530217434c.tar.gz samba-bbbb55eef959cba2cf25c0fc89d770530217434c.tar.xz samba-bbbb55eef959cba2cf25c0fc89d770530217434c.zip | |
recoverd: do_takeover_run() should mark when a takeover run is in progress
Nested takeover runs should never happens so they should fail.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 8ed29c60c0a7dd29f2a6efdf694d38e94281e1c4)
Diffstat (limited to 'ctdb')
| -rw-r--r-- | ctdb/server/ctdb_recoverd.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c index 32c3fde93e..a94fb31431 100644 --- a/ctdb/server/ctdb_recoverd.c +++ b/ctdb/server/ctdb_recoverd.c @@ -67,6 +67,7 @@ struct ctdb_recoverd { struct vacuum_info *vacuum_info; TALLOC_CTX *ip_reallocate_ctx; struct ip_reallocate_list *reallocate_callers; + bool takeover_run_in_progress; TALLOC_CTX *ip_check_disable_ctx; struct ctdb_control_get_ifaces *ifaces; TALLOC_CTX *deferred_rebalance_ctx; @@ -1586,6 +1587,15 @@ static bool do_takeover_run(struct ctdb_recoverd *rec, int ret; bool ok; + if (rec->takeover_run_in_progress) { + DEBUG(DEBUG_ERR, (__location__ + " takeover run already in progress \n")); + ok = false; + goto done; + } + + rec->takeover_run_in_progress = true; + ret = ctdb_takeover_run(rec->ctdb, nodemap, takeover_fail_callback, banning_credits_on_fail ? rec : NULL); if (ret != 0) { @@ -1597,6 +1607,7 @@ static bool do_takeover_run(struct ctdb_recoverd *rec, ok = true; done: rec->need_takeover_run = !ok; + rec->takeover_run_in_progress = false; return ok; } @@ -3952,6 +3963,8 @@ static void monitor_cluster(struct ctdb_context *ctdb) rec->ctdb = ctdb; + rec->takeover_run_in_progress = false; + rec->priority_time = timeval_current(); /* register a message port for sending memory dumps */ |
