From fe3dd9b3e6daf626ea094d1ce5fc96f89c61b7ad Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 8 Aug 2008 11:42:06 +1000 Subject: fixed lots of places that paniced on a failed transaction_commit, thinking it was a failure of a transaction cancel (This used to be commit 22dbe158ed62ae47bbcb41bba3db345294f75437) --- source3/lib/dbwrap_ctdb.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'source3/lib/dbwrap_ctdb.c') 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; -- cgit