retry autocommit mode can retry also MST

Bug #437798 reported by Seppo Jaakola
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL patches by Codership
Fix Released
Medium
Seppo Jaakola

Bug Description

If wsrep_retry_autocommit option is set, then autocommit mode transactions, which were aborted by BF applier, will be retried.
The logic to test for autocommit mode is:

      if (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) &&
          wsrep_retry_autocommit)

However, before we reach this state, the execution has passed end_trans(), where some
thd->options have been cleared:

    thd->options&= ~(OPTION_BEGIN | OPTION_KEEP_LOG);

As a consequence, if session was in autocommit mode, and started transaction with explicit BEGIN, then
autocommit retry logic will retry just the last statement of the aborted multi statement transaction.

Changed in codership-mysql:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Seppo Jaakola (seppo-jaakola)
milestone: none → 0.7
Revision history for this message
Seppo Jaakola (seppo-jaakola) wrote :

A quick fix, with little interference with rest of the code, has been committed.
There is new THD variable for telling if autocommit retry can be tried for this session.

THD::wsrep_retry_autocommit is set before dispatch_command().

A larger refactoring of aborting state model could also be considered.

Changed in codership-mysql:
status: In Progress → Fix Committed
Changed in codership-mysql:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.