I'm writing an infrastructure library for our mysql servers. One of scenarios I have to handle is a temporary disconnection from the mysql server.
The test scenario is start around 100000 inserts to the DB , and then stop the db and bring it back.
During this scenario I'm obiously getting ER_QUERY_INTERRUPTED error on the queries running during stop. The question is:
Can I assume something about the state of the db (like query not started) or regard this as an undefined behaiviour and drop this problem down the chain to user?
Well after some testing the following answers appeared.
We (and most people) use InnoDB whose default mode is transaction . Because of that ER_QUERY_INTERRUPTED
is sent to the client, the query on the server is rolled back. Due to this error handling strategy, in this case, we will be just resubmitting all queries with such error.