summaryrefslogtreecommitdiff
path: root/source3/lib/dbwrap_ctdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/dbwrap_ctdb.c')
-rw-r--r--source3/lib/dbwrap_ctdb.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/source3/lib/dbwrap_ctdb.c b/source3/lib/dbwrap_ctdb.c
index 8efc1ea290..8261e2f733 100644
--- a/source3/lib/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap_ctdb.c
@@ -669,26 +669,28 @@ again:
}
}
- if (ctdb_replay_transaction(h) != 0) {
- DEBUG(0,(__location__ " Failed to replay transaction\n"));
+ if (++retries == 10) {
+ DEBUG(0,(__location__ " Giving up transaction on db 0x%08x after %d retries failure_control=%u\n",
+ h->ctx->db_id, retries, (unsigned)failure_control));
ctdbd_control_local(messaging_ctdbd_connection(), failure_control,
h->ctx->db_id, CTDB_CTRL_FLAG_NOREPLY,
tdb_null, NULL, NULL, NULL);
h->ctx->transaction = NULL;
talloc_free(h);
ctx->transaction = NULL;
- return -1;
+ return -1;
}
- if (++retries == 10) {
- DEBUG(0,(__location__ " Giving up transaction on db 0x%08x after %d retries\n",
- h->ctx->db_id, retries));
+
+ if (ctdb_replay_transaction(h) != 0) {
+ DEBUG(0,(__location__ " Failed to replay transaction failure_control=%u\n",
+ (unsigned)failure_control));
ctdbd_control_local(messaging_ctdbd_connection(), failure_control,
h->ctx->db_id, CTDB_CTRL_FLAG_NOREPLY,
tdb_null, NULL, NULL, NULL);
h->ctx->transaction = NULL;
talloc_free(h);
ctx->transaction = NULL;
- return -1;
+ return -1;
}
goto again;
} else {
@@ -698,7 +700,8 @@ again:
/* do the real commit locally */
ret = tdb_transaction_commit(h->ctx->wtdb->tdb);
if (ret != 0) {
- DEBUG(0,(__location__ " Failed to commit transaction\n"));
+ DEBUG(0,(__location__ " Failed to commit transaction failure_control=%u\n",
+ (unsigned)failure_control));
ctdbd_control_local(messaging_ctdbd_connection(), failure_control, h->ctx->db_id,
CTDB_CTRL_FLAG_NOREPLY, tdb_null, NULL, NULL, NULL);
h->ctx->transaction = NULL;