[MDEV-16442] Document tc.log usage by default and the fact that wsrep in 10.1+ is an XA-capable storage engine Created: 2018-06-08 Updated: 2020-08-25 Resolved: 2019-03-08 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Documentation - Support, Plugins, wsrep, XA |
| Affects Version/s: | 10.1 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Critical |
| Reporter: | Valerii Kravchuk | Assignee: | Kenneth Dyer (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Galera, documentation, tc.log, wsrep | ||
| Issue Links: |
|
||||||||||||
| Description |
|
According to https://mariadb.com/kb/en/library/changes-improvements-in-mariadb-101/, Galera (wsrep stroage engine in SHOW PLUGINS output, to be more specific) is a standard part of MariaDB 10.1 (and newer version). It is not documented anywhere explicitly, but one can conclude from code review and fix for
I found literally nothing in MariaDB KB about the tc.log file and numerous bug reports mentioning failures to create it etc mean that this information is clearly missing. MySQL's reference here, https://dev.mysql.com/doc/refman/5.6/en/server-options.html#option_mysqld_log-tc, refers to multiple storage engines: "... memory-mapped transaction coordinator log file (for XA transactions that affect multiple storage engines when the binary log is disabled)." and is not helpful unless we document Galera (wsrep) engine as the one that causes this file to be created in 10.1+. |
| Comments |
| Comment by Kenneth Dyer (Inactive) [ 2018-12-10 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi valerii, I updated the --log-tc listing on the mysqld options page to show tc.log as the default value. But, I ran into a couple issues while researching for the rest of the ticket:
Does that cover or mitigate the issue? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Valerii Kravchuk [ 2018-12-10 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
What is NOT covered is that in MariaDB 10.1+ we'll have tc.log created in the datadir and maintained by default, with just InnoDB or XtraDB as the onlt XA-capable storage engine, even if wsrep_on is set to OFF and InnoDB is the only XA-capable storage engine listed in SHOW ENGINES. That's because of WSREP support we have included. It does not matter if Galera itself supports XA transactions completely, correctly or not, do they plan to support it or not. tc.log is created and maintained, and it leads to overhead discussed in other MDEVs (like https://jira.mariadb.org/browse/MDEV-16509). This must be documented (or fixed). Fix for | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Valerii Kravchuk [ 2019-03-05 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I do not see any link to any KB article that documents Galera as XA-capable storage engine or explains that tc.log is created and maintained by default in 10.1+ (correct me if I missed it, but --log-tc option description is NOT about this at all). So if you ask me, the problem is not yet fixed and this MDEV can NOT be closed. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Monty Taylor [ 2019-03-05 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I agree with @Valerii, the underlying issue has not be addressed. This just hit me last night - we restarted some mariadb containers as part of a docker-compose action, and were left with mariadb unable to start because it was unhappy with the tc.log file. We're only using innodb, so there is nothing useful in the file. Deleting it caused mariadb to be able to start. What would be better is if tc.log weren't created if it isn't needed - or if startup could be successful after a restart without the user needing to delete the tc.log file. I mean, I can make things always delete tc.log as part of restarting ... but that seems a bit unfortunate. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2019-03-05 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
How's the note here?:
https://mariadb.com/kb/en/library/transaction-coordinator-log-overview/ https://mariadb.com/kb/en/library/xa-transactions/#internal-xa-vs-external-xa | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Valerii Kravchuk [ 2019-03-06 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Yes, these texts cover the topic of this bug report properly. Sorry that I missed them. Based on other comments I think we still need to explain users better (maybe in some notes) why they may unexpectedly see messages about tc.log upon startup in 10.1, when they should just delete it and what are possible performance implications (see | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2019-03-06 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
No worries, valerii. You didn't miss anything. I just added that text today. I just created the entire Transaction Coordinator Log category today. Yeah, those other points are good to ask. We might need input from Codership for those. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2019-03-06 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Interestingly, in MariaDB 10.4, the wsrep plugin type has changed from MYSQL_STORAGE_ENGINE_PLUGIN to MYSQL_REPLICATION_PLUGIN. Here's the definition in the 10.3 branch:
And here's the definition in the 10.4 branch:
Since it's not even a storage engine in MariaDB 10.4, I doubt that it can be a XA-capable storage engine in that version. valerii, do you have a MariaDB 10.4 instance on-hand to see if tc.log is still created when InnoDB is the only XA-capable storage engine? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Valerii Kravchuk [ 2019-03-06 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
From what I see with MariaDB 10.4.4 built from GitHub today WSREP is indeed REPLICATION plugin now and tc.log file is NOT created:
So, this change of 10.4+ is also something to document properly. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2019-03-06 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks, valerii. How's this?:
https://mariadb.com/kb/en/library/transaction-coordinator-log-overview/#mariadb-galera-cluster | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Valerii Kravchuk [ 2019-03-06 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The above is good for my original request, but does not cover concern from the comment by Monty Taylor - when one may have to and can safely remove tc.log upon startup. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2019-03-06 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi valerii, If he saw errors like this:
Then that's already documented here: Can you please share what errors you saw? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Monty Taylor [ 2019-03-07 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I got a different error, basically the one reported here: https://github.com/docker-library/mariadb/issues/201 The "Bad Magic Number" being the key. We've made changes similar to the recommendations in that issue in our deployment, and deleting the tc.log worked as expected since we were only using innodb. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2019-03-07 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Deleting tc.log is a temporary fix. It sounds like this problem can happen every time a docker instance is rebooted. Which of the specific changes mentioned there fixed the problem with the docker instance permanently for you? i.e.:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2019-03-07 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I went ahead and created this section:
https://mariadb.com/kb/en/library/transaction-coordinator-log-overview/#bad-magic-header-in-tc-log |