Last commit made on 2019-09-18
Get this branch:
git clone -b bb-10.5-sujatha

Branch merges

Branch information


Recent commits

cde9170... by Sujatha <email address hidden> on 2019-09-18

MDEV-18648: slave_parallel_mode= optimistic default in 10.5

To change CONSERVATIVE @@global.slave_parallel_mode default to OPTIMISTIC in

Changed default parallel_mode to 'OPTIMISTIC'

Moved 'wait_for_prior_commit(THD *thd)' method inside

Added code to check for 'stop_on_error_sub_id' for event groups which get skipped
and don't have any preceding group to wait for.

Changed default parallel_mode to 'OPTIMISTIC'

Removed the initialization of 'SLAVE_PARALLEL_CONSERVATIVE' to 'opt_slave_parallel_mode' variable.

Added mtr suppression to ignore 'ER_PRIOR_COMMIT_FAILED'. In case of
OPTIMISTIC mode if a transaction gets killed during "wait_for_prior_commit" it
results in above error "1964". Hence suppression needs to be added for this

Test has a 'slave.opt' which explicitly sets
slave_parallel_mode='conservative'. When the test ends this mode conflicts
with new default mode. Hence check test case reports an error. The 'slave.opt'
is removed and options are set and reset within test.

Result content mismatch in "show slave status" output. This is expected as new

Updated default 'slave_parallel_mode' to 'optimistic'.


Refactored rpl_parallel.test into above individual test cases.

rpl_parallel_ignored_errors.test had sporadic failures with following

CURRENT_TEST: rpl.rpl_parallel_ignored_errors
--- /test-10.5/mysql-test/suite/rpl/r/rpl_parallel_ignored_errors.result
+++ /test-10.5/mysql-test/suite/rpl/r/rpl_parallel_ignored_errors.reject
@@ -53,6 +53,7 @@
 SET sql_slave_skip_counter= 1;
 ERROR HY000: When using parallel replication and GTID with multiple
 replication domains, @@sql_slave_skip_counter can not be used. Instead,
 setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID
@@ -62,7 +63,6 @@
 connection server_2;

In general if there are three groups.
1 - Inserts 32 which fails due to local entry '32' on slave.
2 - Inserts 33
3 - Inserts 34

Each group considers itself as a waiter and it waits for prior group 'waitee'.
This is done in 'register_wait_for_prior_event_group_commit'. If there is no
other parallel group being scheduled then no waitee will be there.

Let us assume 3 groups are being scheduled in parallel.

3-> waits for 2-> waits for->1

'1' upon completion it checks is there any registered subsequent waiter. If
so it wakes up the subsequent waiter with its execution status. This execution
status is stored in wakeup_error.

If '1' failed then it sends corresponding wakeup_error to 2. Then '2' aborts
and it propagates error to '3'. So all further commits are aborted. This
mechanism works only when all transactions reach a stage where they are
waiting for their prior commit to complete.

In case of optimistic following scenario occurs.

1,2,3 are scheduled in parallel.

3 - Reaches group_commit_code waits for 2 to complete.
1 - errors out sets stop_on_error_sub_id=1.

When a group execution results in error its corresponding sub_id is set to
'stop_on_error_sub_id'. Any new groups queued for execution will check if
their sub_id is > stop_on_error_sub_id. If it is true their execution will be
skipped as prior group execution failed. 'skip_event_group=1' will be set.
Since the execution of SQL thread is about to stop we just skip execution of
all the following event groups. We still do all the normal waiting and wakeup
processing between the event groups as a simple way to ensure that everything
is stopped and cleaned up correctly.

Upon error '1' transaction checks for registered waiters. Since no one is
there it simply goes away.

2 - Starts the execution. It checks do I have a waitee.

Since wait_commit_sub_id == entry->last_committed_sub_id no waitee is set.

Secondly: 'entry->stop_on_error_sub_id' is set by '1'st execution. Now
'handle_parallel_thread' code checks if the current group 'sub_id' is greater
than the 'sub_id' set within 'stop_on_error_sub_id'.

Since the above is true 'skip_event_group=true' is set. Simply call
'wait_for_prior_commit' to wakeup all waiters. Group '2' didn't had any
waitee and its execution is skipped. Hence its wakeup_error=0.It sends a
positive wakeup signal to '3'. Which commits. This results in a missed
transaction. i.e 33 is missed.

Fix is to check for 'ston_on_error_sub_id' during wakeup. Please check specific changes.

Some recent commit information could not be fetched.