{
struct db_record *rh;
TDB_DATA key;
- struct ctdb_ltdb_header header;
TALLOC_CTX *tmp_ctx;
const char *keyname = CTDB_TRANSACTION_LOCK_KEY;
int ret;
ctx->transaction = h;
+ DEBUG(5,(__location__ " Started transaction on db 0x%08x\n", ctx->db_id));
+
return 0;
}
TDB_DATA key)
{
struct db_record *result;
- NTSTATUS status;
TDB_DATA ctdb_data;
- int migrate_attempts = 0;
if (!(result = talloc(mem_ctx, struct db_record))) {
DEBUG(0, ("talloc failed\n"));
NTSTATUS rets;
int ret;
int status;
- struct timeval timeout;
struct db_ctdb_transaction_handle *h = ctx->transaction;
if (h == NULL) {
return -1;
}
- talloc_set_destructor(h, NULL);
+ DEBUG(5,(__location__ " Commit transaction on db 0x%08x\n", ctx->db_id));
if (h->m_write == NULL) {
/* no changes were made */
talloc_free(h);
+ ctx->transaction = NULL;
return 0;
}
+ talloc_set_destructor(h, NULL);
+
/* our commit strategy is quite complex.
- we first try to commit the changes to all other nodes
tdb_null, NULL, NULL, NULL);
h->ctx->transaction = NULL;
talloc_free(h);
+ ctx->transaction = NULL;
return -1;
}
goto again;
return -1;
}
+ DEBUG(5,(__location__ " Cancel transaction on db 0x%08x\n", ctx->db_id));
+
ctx->transaction = NULL;
talloc_free(h);
return 0;
return tdb_get_seqnum(ctx->wtdb->tdb);
}
-static int db_ctdb_trans_dummy(struct db_context *db)
-{
- /*
- * Not implemented yet, just return ok
- */
- return 0;
-}
-
struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
const char *name,
int hash_size, int tdb_flags,
return NULL;
}
+ db_ctdb->transaction = NULL;
+
if (!NT_STATUS_IS_OK(ctdbd_db_attach(messaging_ctdbd_connection(),name, &db_ctdb->db_id, tdb_flags))) {
DEBUG(0, ("ctdbd_db_attach failed for %s\n", name));
TALLOC_FREE(result);