summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/dbwrap_ctdb.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source3/lib/dbwrap_ctdb.c b/source3/lib/dbwrap_ctdb.c
index 16c626632d..645b93846b 100644
--- a/source3/lib/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap_ctdb.c
@@ -597,6 +597,7 @@ static int db_ctdb_transaction_commit(struct db_context *db)
NTSTATUS rets;
int ret;
int status;
+ int retries = 0;
struct db_ctdb_transaction_handle *h = ctx->transaction;
if (h == NULL) {
@@ -648,6 +649,17 @@ again:
ctx->transaction = NULL;
return -1;
}
+ if (retries++ == 10) {
+ DEBUG(0,(__location__ " Giving up transaction on db 0x%08x after %d retries\n",
+ h->ctx->db_id, retries));
+ ctdbd_control_local(messaging_ctdbd_connection(), CTDB_CONTROL_TRANS2_ERROR,
+ 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;
+ }
goto again;
}