sleep(1);
if (ctdb_replay_transaction(h) != 0) {
DEBUG(DEBUG_ERR,(__location__ " Failed to replay transaction\n"));
+ ctdb_control(ctdb, CTDB_CURRENT_NODE, h->ctdb_db->db_id,
+ CTDB_CONTROL_TRANS2_ERROR, CTDB_CTRL_FLAG_NOREPLY,
+ tdb_null, NULL, NULL, NULL, NULL, NULL);
talloc_free(h);
return -1;
}
if (client->num_persistent_updates == 0) {
DEBUG(DEBUG_ERR, (__location__ " ERROR: num_persistent_updates == 0\n"));
+ DEBUG(DEBUG_ERR,(__location__ " Forcing recovery\n"));
+ client->ctdb->recovery_mode = CTDB_RECOVERY_ACTIVE;
return -1;
}
client->num_persistent_updates--;
if (client->num_persistent_updates == 0) {
DEBUG(DEBUG_ERR, (__location__ " ERROR: num_persistent_updates == 0\n"));
- return -1;
+ } else {
+ client->num_persistent_updates--;
}
- client->num_persistent_updates--;
DEBUG(DEBUG_ERR,(__location__ " Forcing recovery\n"));
client->ctdb->recovery_mode = CTDB_RECOVERY_ACTIVE;