[MDEV-18393] Galera node kills after DELETE statement with foreign keys Created: 2019-01-28 Updated: 2020-10-28 Resolved: 2020-10-28 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Galera |
| Affects Version/s: | 10.1.37 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Critical |
| Reporter: | Pim Rupert | Assignee: | Seppo Jaakola |
| Resolution: | Cannot Reproduce | Votes: | 4 |
| Labels: | None | ||
| Environment: |
Linux 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
Galera node kills itself after two DELETE statements in tables with a FK. This looks like a repetition of bug Statements run on 'master1':
Resulting in shutdown on 'master2':
|
| Comments |
| Comment by Jan Lindström (Inactive) [ 2019-02-08 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi, could you please provide show create table output for invoice, invoice_data and any other related table. Additionally, please provide node configuration. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Pim Rupert [ 2019-02-12 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@jplindst hereby the `SHOW CREATE TABLE` output and mysqld configuration:
Configuration:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2019-02-13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thank you, can I also have show create table for projects, users and invoice_type. Is those delete-clauses always done only a one server i.e. master1 or do you run them on other nodes in the cluster as well ? Note that foreign key invoice_data_ibfk_6 does not have on delete action. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Pim Rupert [ 2019-02-14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Yes, DELETE (and all other write) statements are only run on master1.
Hereby:
Thank you! | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2019-02-26 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi and thank you. I failed to repeat this problem. As I expected your database contains complex foreign key tree. Questions:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Pim Rupert [ 2019-02-26 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Jan, > When you issue delete on invoice_data and invoice do you use same project_id ? Yes. > Can you repeat this if master2 has wsrep_sync_wait=15 setting ? But doesn't that halt / slow down all cluster writes? We are hesitant in making this change on a production cluster before fully understanding the impact. > Can you share full exported database where this repeats or repeatable test case ? We have noticed that this issue is very hard to reproduce. To me it looks like a race condition bug with Galera replication and foreign key checks. We were also thinking about trying to set wsrep_slave_thread to 1 in stead of 16 as a possible work-around. What do you think about that? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marco Menzel [ 2019-03-04 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
10.2.22 still crashing with same problem, only if wsrep_slave_thread > 1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Pim Rupert [ 2019-03-05 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Marco, Do you have an easily reproducible case? We find it incredibly hard to reproduce the problem on our 10.1 cluster. > only if wsrep_slave_thread > 1 You did not have the issue when setting wsrep_slave_threads to 1? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marco Menzel [ 2019-03-13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Sorry, no reproducible case available. With wsrep_slave_threads = 1 the issue does'nt occur so far. There are some foreign key constructs without 'ON DELETE'. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2019-03-15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Tried to repeat with different kind of deletes and data (see attached test case) but failed. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Brendan P [ 2019-05-27 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This one isn't easily reproducible at all and occurs completely at random, but is more often to occur when you stress your many wsrep applier threads, such as with a large table alter using an online ddl tool like pt-online-schema-change to alter your table. Something is not sanity checking the execution ordering of the queries with ON QUERYTYPE CASCADE FK statements. I've had several cases where a simple table rename gets replicated before all the queries that do triggers to that table even get applied, causing the slave to abort on a FK apply error to a table that no longer exists... |