Done
Details
Assignee
Krunal BauskarKrunal Bauskar(Deactivated)Reporter
Nickolay IhalainenNickolay Ihalainen(Deactivated)Time tracking
1d 5h 45m loggedFix versions
Affects versions
Priority
Medium
Details
Details
Assignee
Krunal Bauskar
Krunal Bauskar(Deactivated)Reporter
Nickolay Ihalainen
Nickolay Ihalainen(Deactivated)Time tracking
1d 5h 45m logged
Fix versions
Affects versions
Priority
Smart Checklist
Smart Checklist
Smart Checklist
Created January 29, 2019 at 7:41 AM
Updated March 6, 2024 at 10:18 PM
Resolved January 13, 2020 at 3:47 AM
REPLACE statements changing the same row running in parallel on multiple nodes locking alter table with MDL.
Second node:
Very similar issue happens on production system:
There is an application thread executing several replace queries in transaction
If commit returns error application re-sends last replace statement and executing commit statement
One of these commit staled in "wsrep: initiating pre-commit for write set" (doing galera::Monitor<galera::ReplicatorSMM::ApplyOrder>::self_cancel)
alter table statement (online index creation) is trying to get exclusive MDL.
How to Reproduce
I have a script:
and a cluster created from:
entrypoint.sh in my local directory is a modified one from percona/percona-xtradb-cluster:
I've commented out mysql_tzinfo_to_sql and added SET @@SESSION.wsrep_on=0; before SET @@SESSION.SQL_LOG_BIN=0;
On both nodes I've set global trx_commit=0, sync_binlog=0, autocommit=0
The table
filled the table with 8M records (numbers from 1-8M, pad = id).
when load.sh workload started, executed alter table test.t add key(pad); on the first node.
after 2k seconds killed commit in "wsrep: initiating replication for write set (-1) " state on the first node and after that commit (non-system thread) on the second node.
From this point I have a stale with MDL waiting