aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2018-09-09 08:27:46 +1000
committerKarolin Seeger <kseeger@samba.org>2018-09-20 09:13:11 +0200
commit43c1ad1537debb538bfa7d304584ddb84344a379 (patch)
tree140e54d01f7ede514e46af6d0bc11b73e1d530d8
parenteb498ec2baea154bdba313fc495a9dc7e0322f77 (diff)
downloadsamba-43c1ad1537debb538bfa7d304584ddb84344a379.tar.gz
samba-43c1ad1537debb538bfa7d304584ddb84344a379.tar.xz
samba-43c1ad1537debb538bfa7d304584ddb84344a379.zip
ctdb-recoverd: Clean up taking of recovery lock
No functional changes, just coding style cleanups and debug message tweaks. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13617 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 59fc01646c7d65ba90b0a1a34c3795ff842351c5)
-rw-r--r--ctdb/server/ctdb_recoverd.c41
1 files changed, 24 insertions, 17 deletions
diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c
index 2b94fed7478..28b5e2b6c2d 100644
--- a/ctdb/server/ctdb_recoverd.c
+++ b/ctdb/server/ctdb_recoverd.c
@@ -1305,31 +1305,38 @@ static int do_recovery(struct ctdb_recoverd *rec,
goto fail;
}
- if (ctdb->recovery_lock != NULL) {
+ if (ctdb->recovery_lock != NULL) {
if (ctdb_recovery_have_lock(rec)) {
- DEBUG(DEBUG_NOTICE, ("Already holding recovery lock\n"));
+ D_NOTICE("Already holding recovery lock\n");
} else {
- DEBUG(DEBUG_NOTICE, ("Attempting to take recovery lock (%s)\n",
- ctdb->recovery_lock));
- if (!ctdb_recovery_lock(rec)) {
- if (ctdb->runstate == CTDB_RUNSTATE_FIRST_RECOVERY) {
- /* If ctdb is trying first recovery, it's
- * possible that current node does not know
- * yet who the recmaster is.
+ bool ok;
+
+ D_NOTICE("Attempting to take recovery lock (%s)\n",
+ ctdb->recovery_lock);
+
+ ok = ctdb_recovery_lock(rec);
+ if (! ok) {
+ D_ERR("Unable to take recovery lock\n");
+ if (ctdb->runstate ==
+ CTDB_RUNSTATE_FIRST_RECOVERY) {
+ /*
+ * First recovery? Perhaps
+ * current node does not yet
+ * know who the recmaster is.
*/
- DEBUG(DEBUG_ERR, ("Unable to get recovery lock"
- " - retrying recovery\n"));
+ D_ERR("Retrying recovery\n");
goto fail;
}
- DEBUG(DEBUG_ERR,("Unable to get recovery lock - aborting recovery "
- "and ban ourself for %u seconds\n",
- ctdb->tunable.recovery_ban_period));
- ctdb_ban_node(rec, pnn, ctdb->tunable.recovery_ban_period);
+ D_ERR("Abort recovery, "
+ "ban this node for %u seconds\n",
+ ctdb->tunable.recovery_ban_period);
+ ctdb_ban_node(rec,
+ pnn,
+ ctdb->tunable.recovery_ban_period);
goto fail;
}
- DEBUG(DEBUG_NOTICE,
- ("Recovery lock taken successfully by recovery daemon\n"));
+ D_NOTICE("Recovery lock taken successfully\n");
}
}