summaryrefslogtreecommitdiff
path: root/source3/lib/dbwrap_ctdb.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-10-31 13:13:04 +0100
committerMichael Adam <obnox@samba.org>2009-11-03 01:02:38 +0100
commit9fef6a6666d59ee8cc2ef41f96efa3dd2efba30c (patch)
treeaff34e1d653184aa5b3ac02da249bb58fefc58bf /source3/lib/dbwrap_ctdb.c
parentf37439efd2fbd9a9e995d838da20d60337ca07f7 (diff)
downloadsamba-9fef6a6666d59ee8cc2ef41f96efa3dd2efba30c.tar.gz
samba-9fef6a6666d59ee8cc2ef41f96efa3dd2efba30c.tar.bz2
samba-9fef6a6666d59ee8cc2ef41f96efa3dd2efba30c.zip
s3:dbwrap_ctdb: split combined check in two and add descriptive debug
in db_ctdb_transaction_fetch_start() for error conditions when re-fetching the transaction_lock record inside the transaction Michael
Diffstat (limited to 'source3/lib/dbwrap_ctdb.c')
-rw-r--r--source3/lib/dbwrap_ctdb.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source3/lib/dbwrap_ctdb.c b/source3/lib/dbwrap_ctdb.c
index fef984c8c3..1f6af437cf 100644
--- a/source3/lib/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap_ctdb.c
@@ -399,7 +399,20 @@ again:
}
status = db_ctdb_ltdb_fetch(ctx, key, &header, tmp_ctx, &data);
- if (!NT_STATUS_IS_OK(status) || header.dmaster != get_my_vnn()) {
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0, (__location__ " failed to refetch transaction lock "
+ "record inside transaction: %s - retrying\n",
+ nt_errstr(status)));
+ tdb_transaction_cancel(ctx->wtdb->tdb);
+ talloc_free(tmp_ctx);
+ goto again;
+ }
+
+ if (header.dmaster != get_my_vnn()) {
+ DEBUG(3, (__location__ " refetch transaction lock record : "
+ "we are not dmaster any more "
+ "(dmaster[%u] != my_vnn[%u]) - retrying\n",
+ header.dmaster, get_my_vnn()));
tdb_transaction_cancel(ctx->wtdb->tdb);
talloc_free(tmp_ctx);
goto again;