#
# Test SR BF abort for all sync points in master side code path
#
# The procedurein all test cases is the following:
# 1) Start SR transaction on node 1, do INSERT + SELECT .. FOR UPDATE
# 2) Set up sync point on node 1to block slave thread processing
# in apply monitor
# 3) Do write on node 2 which will conflict with SELECT .. FOR UPDATE
# 4) Set up desired sync point on master side and commit
# 5) Wait until commit reaches master side sync point, clear sync points
# and release all sync point waiters
# 6) COMMIT on node 1 should return deadlock error
#
# Deadlock should now be retured by node_1
--connection node_1 if (!$galera_sr_bf_abort_at_commit)
{
--error ER_LOCK_DEADLOCK
--reap
} if ($galera_sr_bf_abort_at_commit)
{
--reap
}
# End result:
# If the statement which was BF aborted was commit,
# node_1 must replay the transaction so that the table
# will have rows 1, 2. If it in turn was INSERT,
# node_1 must abort the transaction so that only
# INSERT ... VALUES (2) survives.
--connection node_1
SELECT * FROM t1; if ($galera_sr_bf_abort_at_commit)
{
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1;
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
} if (!$galera_sr_bf_abort_at_commit)
{
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
}
--connection node_2
SELECT * FROM t1; if ($galera_sr_bf_abort_at_commit)
{
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1;
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
} if (!$galera_sr_bf_abort_at_commit)
{
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
}
--connection node_1
SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log;
--connection node_2
SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log;
# Delete entery to verify that node is unblocked
--connection node_1 SET AUTOCOMMIT=ON; SET SESSION wsrep_trx_fragment_size = 0;
DELETE FROM t1;
DROP TABLE t1;
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.18 Sekunden
(vorverarbeitet am 2026-10-11)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.