summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2008-08-08 11:42:06 +1000
committerMichael Adam <obnox@samba.org>2008-08-13 11:54:10 +0200
commitfe3dd9b3e6daf626ea094d1ce5fc96f89c61b7ad (patch)
tree4faa4a4856cef00f85e2b210e4a5f28b7befd8ad /source3/lib
parent312a04528c2f3439f0451414fee224dfa4fcb6f4 (diff)
downloadsamba-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')
-rw-r--r--source3/lib/account_pol.c3
-rw-r--r--source3/lib/dbwrap_ctdb.c19
-rw-r--r--source3/lib/sharesec.c2
3 files changed, 14 insertions, 10 deletions
diff --git a/source3/lib/account_pol.c b/source3/lib/account_pol.c
index 7fc565121c..1e435ca53e 100644
--- a/source3/lib/account_pol.c
+++ b/source3/lib/account_pol.c
@@ -283,7 +283,8 @@ bool init_account_policy(void)
if (db->transaction_commit(db) != 0) {
DEBUG(0, ("transaction_commit failed\n"));
- goto cancel;
+ TALLOC_FREE(db);
+ return false;
}
return True;
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;
diff --git a/source3/lib/sharesec.c b/source3/lib/sharesec.c
index e64611f154..4380000080 100644
--- a/source3/lib/sharesec.c
+++ b/source3/lib/sharesec.c
@@ -109,7 +109,7 @@ static bool share_info_db_init(void)
if (share_db->transaction_commit(share_db) != 0) {
DEBUG(0, ("transaction_commit failed\n"));
- goto cancel;
+ return false;
}
return true;