MariaDB server is a community developed fork of MySQL server. Started by core members of the original MySQL team, MariaDB actively works with outside developers to deliver the most featureful, stable, and sanely licensed open SQL server in the industry.
Find a file
Sujatha 9b80f9300d MDEV-20645: Replication consistency is broken as workers miss the error notification from an earlier failed group.
Analysis:
========
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 and 34 is committed.

Fix:
===
When a worker learns that an earlier transaction execution has failed, and it
should not proceed for further execution, it should mark its own execution
status as failed so that it alerts its followers to abort as well.
2019-09-30 13:22:37 +05:30
BUILD Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
client imporve clang build 2019-06-25 13:21:36 +03:00
cmake Merge remote-tracking branch 'origin/5.5' into 10.1 2019-09-24 11:18:39 +04:00
dbug Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
debian Deb: Implement proper version detection in maintainer scripts 2019-09-18 10:58:16 +03:00
Docs MDEV-19563 Removed references to deprecated option innodb_locks_unsafe_for_binlog 2019-06-12 13:00:08 +03:00
extra MDEV-17638 Improve error message about corruption of encrypted page 2019-08-01 16:49:17 +03:00
include fix clang warnings 2019-08-28 10:14:20 +03:00
libmysql Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
libmysqld Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
libservices Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
man MDEV-19537: Document mysqlimport option ignore-foreign-keys 2019-05-21 17:04:18 +04:00
mysql-test MDEV-20645: Replication consistency is broken as workers miss the error notification from an earlier failed group. 2019-09-30 13:22:37 +05:30
mysys Merge 5.5 into 10.1 2019-05-28 11:25:45 +03:00
mysys_ssl Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
pcre Merge branch 'merge-pcre' into 10.1 2019-04-26 16:11:55 +02:00
plugin Merge branch '5.5' into 10.1 2019-07-25 13:27:11 +02:00
randgen/conf Group commit for maria engine. 2010-02-12 15:12:28 +02:00
scripts MDEV-20614: Syntax error, and option put in wrong place 2019-09-26 11:11:43 +02:00
sql MDEV-20645: Replication consistency is broken as workers miss the error notification from an earlier failed group. 2019-09-30 13:22:37 +05:30
sql-bench Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
sql-common MDEV-19034 ASAN unknown-crash in get_date_time_separator with PAD_CHAR_TO_FULL_LENGTH 2019-08-20 05:28:14 +04:00
storage Merge remote-tracking branch 'origin/5.5' into 10.1 2019-09-24 11:18:39 +04:00
strings Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
support-files chkconfig in RPM server scriptlets 2019-09-27 13:20:11 +02:00
tests Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
unittest Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
vio Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
win Merge branch '5.5' into 10.1 2019-07-25 13:27:11 +02:00
wsrep Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
zlib restore RESTRICT_SYMBOL_EXPORTS(zlib) 2019-07-10 08:58:28 +02:00
.clang-format MDEV-13631 Make use of clang-format 2019-06-12 22:36:43 +03:00
.gitattributes Merge branch '10.0' into 10.1 2018-05-05 14:01:59 +02:00
.gitignore Merge branch '10.0' into 10.1 2018-10-30 15:10:01 +01:00
BUILD-CMAKE various documentation updates 2012-06-18 16:57:58 -04:00
CMakeLists.txt MDEV-19360 - Disable _FORTIFY_SOURCE for ASAN builds 2019-06-07 12:47:41 +04:00
config.h.cmake Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
configure.cmake Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
COPYING Update FSF Address 2019-05-11 21:29:06 +03:00
COPYING.thirdparty Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
CREDITS Update contributors 2018-09-10 16:47:44 +04:00
EXCEPTIONS-CLIENT MDEV-5645 MariaDB-5.5.35 - references are made to an "EXCEPTIONS-CLIENT" file but it does not exist 2014-05-31 13:18:56 +02:00
INSTALL-SOURCE Update AskMonty and Atlassian references to MariaDB 2016-03-08 15:24:01 +02:00
INSTALL-WIN-SOURCE Update AskMonty and Atlassian references to MariaDB 2016-03-08 15:24:01 +02:00
KNOWN_BUGS.txt various documentation updates 2012-06-18 16:57:58 -04:00
README Update FSF Address 2019-05-11 21:29:06 +03:00
VERSION bump the VERSION 2019-07-31 09:55:57 -04:00

MariaDB is designed as a drop-in replacement of MySQL(R) with more
features, new storage engines, fewer bugs, and better performance.

MariaDB is brought to you by the MariaDB Foundation.
Please read the CREDITS file for details about the MariaDB Foundation,
and who is developing MariaDB.

MariaDB is developed by many of the original developers of MySQL who
now work for the MariadB Foundation and the MariaDB Corporation, and by many people in
the community.

MySQL, which is the base of MariaDB, is a product and trademark of Oracle
Corporation, Inc. For a list of developers and other contributors,
see the Credits appendix.  You can also run 'SHOW authors' to get a
list of active contributors.

A description of the MariaDB project and a manual can be found at:
http://mariadb.org/
https://mariadb.com/kb/en/
https://mariadb.com/kb/en/mariadb-vs-mysql-features/
https://mariadb.com/kb/en/mariadb-versus-mysql-features/
https://mariadb.com/kb/en/mariadb-versus-mysql-compatibility/

As MariaDB is a full replacement of MySQL, the MySQL manual at
http://dev.mysql.com/doc is generally applicable.

More help is available from the Maria Discuss mailing list
https://launchpad.net/~maria-discuss
and the #maria IRC channel on Freenode.

***************************************************************************

NOTE: 

MariaDB is specifically available only under version 2 of the GNU
General Public License (GPLv2). (I.e. Without the "any later version"
clause.) This is inherited from MySQL. Please see the README file in
the MySQL distribution for more information.

License information can be found in the COPYING, COPYING.LESSER,
and COPYING.thirdparty files.

***************************************************************************

IMPORTANT:

Bug and/or error reports regarding MariaDB should be submitted at:
https://jira.mariadb.org

For reporting security vulnerabilities see:
https://mariadb.org/about/security-policy/

Bugs in the MySQL code can also be submitted at:
http://bugs.mysql.com

The code for MariaDB, including all revision history, can be found at:
https://github.com/MariaDB/server

***************************************************************************