The gap that remained is between checking whether a transaction commit
is in progress and taking the lock. Now we first take the lock and then
check whether a transaction commit is in progress. If so, we release the
lock, wait for one second and retry.
Michael
+ tmp_ctx = talloc_new(h);
+
+ rh = ctdb_fetch_lock(ctdb_db, tmp_ctx, key, NULL);
+ if (rh == NULL) {
+ DEBUG(DEBUG_ERR,(__location__ " Failed to fetch_lock database\n"));
+ talloc_free(tmp_ctx);
+ return -1;
+ }
+
status = ctdb_ctrl_transaction_active(ctdb_db->ctdb,
CTDB_CURRENT_NODE,
ctdb_db->db_id);
status = ctdb_ctrl_transaction_active(ctdb_db->ctdb,
CTDB_CURRENT_NODE,
ctdb_db->db_id);
DEBUG(DEBUG_NOTICE, (__location__ " transaction is active "
"on db_id[0x%08x]. waiting for 1 second\n",
ctdb_db->db_id));
DEBUG(DEBUG_NOTICE, (__location__ " transaction is active "
"on db_id[0x%08x]. waiting for 1 second\n",
ctdb_db->db_id));
- tmp_ctx = talloc_new(h);
-
- rh = ctdb_fetch_lock(ctdb_db, tmp_ctx, key, NULL);
- if (rh == NULL) {
- DEBUG(DEBUG_ERR,(__location__ " Failed to fetch_lock database\n"));
- talloc_free(tmp_ctx);
- return -1;
- }
/*
* store the pid in the database:
* it is not enough that the node is dmaster...
/*
* store the pid in the database:
* it is not enough that the node is dmaster...