}
}
- 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 {
/* 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;
if (db->transaction_commit(db) != 0) {
DEBUG(0, ("Could not commit transaction\n"));
- goto cancel;
+ return false;
}
return true;
if (db_sam->transaction_commit(db_sam) != 0) {
DEBUG(0, ("Could not commit transaction\n"));
- goto cancel;
+ return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
return NT_STATUS_OK;
if (db_sam->transaction_commit(db_sam) != 0) {
DEBUG(0, ("Could not commit transaction\n"));
- goto cancel;
+ return false;
}
return true;
* account back?
*/
DEBUG(0, ("transaction_commit failed\n"));
- goto cancel;
+ TALLOC_FREE(new_acct);
+ return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
TALLOC_FREE(new_acct );