diff options
author | Andrew Tridgell <tridge@samba.org> | 2008-08-08 11:42:06 +1000 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2008-08-13 11:54:10 +0200 |
commit | fe3dd9b3e6daf626ea094d1ce5fc96f89c61b7ad (patch) | |
tree | 4faa4a4856cef00f85e2b210e4a5f28b7befd8ad /source3/lib/dbwrap_ctdb.c | |
parent | 312a04528c2f3439f0451414fee224dfa4fcb6f4 (diff) | |
download | samba-fe3dd9b3e6daf626ea094d1ce5fc96f89c61b7ad.tar.gz samba-fe3dd9b3e6daf626ea094d1ce5fc96f89c61b7ad.tar.bz2 samba-fe3dd9b3e6daf626ea094d1ce5fc96f89c61b7ad.zip |
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)
Diffstat (limited to 'source3/lib/dbwrap_ctdb.c')
-rw-r--r-- | source3/lib/dbwrap_ctdb.c | 19 |
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; |