ctdbd: refuse PERSISTENT_STORE if transaction is running.
[metze/ctdb/wip.git] / server / ctdb_persistent.c
index 70233ce5c416047a7e3aa90b5d0710a5f0ffc740..f7578d158607bd4857592e20a583cae3e05b6bd0 100644 (file)
@@ -137,6 +137,11 @@ int32_t ctdb_control_trans2_commit(struct ctdb_context *ctdb,
        */
        switch (c->opcode) {
        case CTDB_CONTROL_PERSISTENT_STORE:
+               if (ctdb_db->transaction_active) {
+                       DEBUG(DEBUG_ERR, (__location__ " trans2_commit client db_id[%d] transaction active - refusing persistent store\n",
+                               client->db_id));
+                       return -1;
+               }
                if (client->num_persistent_updates > 0) {
                        client->num_persistent_updates--;
                }