[MDEV-30665] MariaDB 10.6.12 hang 2 days after upgrade Created: 2023-02-16 Updated: 2023-04-17 Resolved: 2023-04-17 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Manipulation - Insert, Replication, Server |
| Affects Version/s: | 10.6.12 |
| Fix Version/s: | 11.1.1, 10.11.3, 11.0.2, 10.6.13, 10.8.8, 10.9.6, 10.10.4 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Oli Sennhauser | Assignee: | Marko Mäkelä |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | hang | ||
| Environment: |
Ubuntu 20.04, n.a. |
||
| Attachments: |
|
||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
Today our production server was suddenly hanging. The only thing that changed was an upgrade from 10.6.11 to 10.6.12 2 days ago. So I assume it has something to do with the new release because we never experienced this before. How did we find: Script complained that it was already running. So previous run of script did not terminate for long time. Database shows:
Killing did not help:
We did not see any message in the error log. A proper shutdown (-15) was NOT successful. The database did just not terminate in a decent amount of time: Status information:
Kill -9 helped.
Please let me know what I should gather as information if it happens the next time... |
| Comments |
| Comment by Marko Mäkelä [ 2023-02-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
oli, can you enable a core dump of the server and get a full stack trace of all threads the next time when it happens? Please be sure to install a -debuginfo or -dbgsym package, so that the function call parameters and their values will be available in the stack traces. I am currently aware of 2 hanging bugs in InnoDB, which I have mentioned in | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oli Sennhauser [ 2023-02-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
We are working with binary tarballs. I did not find debuginfo or dbgsym tar.gz on your site (or the mirrors) and there was also not such binary in the normal tar.gz: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-02-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
If the server hangs and does not crash by itself, you can attach GDB to the running process to produce stack traces of all threads. I looked up and adapted the following command from an earlier ticket:
It might be helpful to collect multiple successive samples, to more reliably determine which threads are actually hung, in case some polling loops are involved. For a normal non-stripped executable, I don’t think that there will be detailed debugging information available, only function names, but no source code line numbers or information about variables. That might still be enough to identify it as a duplicate of a known bug. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oli Sennhauser [ 2023-02-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I had the idea to extract the mariadbd + the debugsymbols from the ubuntu package and replace the tarball mariadbd with it. But there are so many files in the ddeb packages. And I have no clue how choose the right files: https://mirror.mva-n.net/mariadb/repo/10.6/ubuntu/pool/main/m/mariadb-10.6/mariadb-server-10.6-dbgsym_10.6.12+maria~ubu2004_amd64.ddeb Any suggestion? How many samples and how big should the interval be? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-02-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I have not checked what exactly is in the -dbgsym packages. For GDB, I think that the main piece of interest are the /usr/lib/debug/.build-id//.debug files. I am not completely sure, but it might be that only the file that matches the BuildID reported by file mariadbd is needed. You could start with 5 samples, taken a few seconds apart. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oli Sennhauser [ 2023-02-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hmm. I have completely destroyed my production and I have no clue why! For the notes: Files must be copied here: /usr/lib/debug/.build-id//.debug readelf -x.gnu_debuglink mariadbd Hex dump of section '.gnu_debuglink': | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oli Sennhauser [ 2023-02-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
So I finally manage to make it work... Can you please check if this is what your want? I will failback on Monday and then wait for the prey... | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oli Sennhauser [ 2023-02-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-02-21 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
oli, I am sorry for the delay. In test_backtrace.trc I see that Thread 15 is waiting for something in mysql_binlog_send() and MYSQL_BIN_LOG::wait_for_update_binlog_end_pos(). Also Thread 11 is waiting in MYSQL_BIN_LOG::wait_for_update_relay_log() as part of exec_relay_log_event(). Thread 10 is apparently reading something from a connection. Thread 8 (binlog_background_thread() is in a timed wait. I think that these threads must be the reason for the hang. Can you describe your replication topology? Did you see any errors reported from anything that could be connected to Thread 8? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrei Elkin [ 2023-02-21 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
oli, marko: the replication threads including 11,15 are probably in non-disturbed state that is never having received KILLed signal. oli, can you record thread apply all backtrace at time of SHUTDOWN sql returns (after timeout?)? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oli Sennhauser [ 2023-02-21 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
As Andrei commented correctly this was just a test to see if this is what you want and need it case it happens again. I wait now for the event if it happens again. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oli Sennhauser [ 2023-03-09 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hello all This morning we had the case again and I hope I could collect all the needed information:
Connection id: 326836 Threads: 36 Questions: 4538579 Slow queries: 2893 Opens: 736 Open tables: 730 Queries per second avg: 26.654
for i in $(seq 5) ; do
2023-03-09 8:19:33 0 [Note] bin/mysqld (initiated by: unknown): Normal shutdown 2023-03-09 8:21:39 0 [Note] Starting MariaDB 10.6.12-MariaDB-1:10.6.12+maria~ubu2004-log source revision 4c79e15cc3716f69c044d4287ad2160da8101cdc as process 1342234
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oli Sennhauser [ 2023-03-09 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2023-03-09 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The backtraces looks very much like those analyzed yesterday in | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oli Sennhauser [ 2023-03-14 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Happened again this morning. Collected some data. It seems to be somehow related to the machine restart: 14. Feb 09:30 restart machine + database 07. Mar 08:45 restart machine + database 09. Mar 08:10 restart database I will restart the machine again now. So I expect the problem to appear again within the next 48 hours. If you provide me a fixed binary I can try if problem goes away. For the note: I should try if the problem does not happen when just the DB is restarted... | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrei Elkin [ 2023-03-16 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I walked through one of the traces to find few threads in a waiting state like in the following:
marko certainly has take a look. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oli Sennhauser [ 2023-03-23 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Happened again last night at 2023-03-22 21:14 After about 9 days. Restarted database expecting that it does not happen again when database is restarted without server reboot. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oli Sennhauser [ 2023-03-28 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I definitely happens also WITHOUT machine reboot. So this can be excluded. We also used the GUI heavily the last days and it did not trigger the problem. So also this is not the reason of the problem. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-03-30 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
oli, a user just today reported that with a custom build that includes a fix of Can you try the same? It was https://ci.mariadb.org/33215/ for the original custom build, but the fix is included in any recent development snapshot of the 10.6 branches or later. Example: click on the leftmost link next to tarball-docker in https://buildbot.mariadb.org/#/grid?branch=10.6 to see the build number: https://buildbot.mariadb.org/#/builders/1/builds/33837 for the currently latest 10.6 branch. Then, navigate to https://ci.mariadb.org/33837/ or right to your platform, say, https://ci.mariadb.org/33837/amd64-ubuntu-2004-deb-autobake/debs/ and download the packages there. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-03-30 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I checked the file gdb_1.trc in mdev_30665_1.tar.gz There is not enough information to say for sure if this is a duplicate of
Some more detail:
On 64-bit platforms, the block descriptor address in 10.6 or later branches should be 0x18 bytes less than the address of the lock. In this case, it would have been 0x7f7233866de0. We’d have to find the mtr_t::memo entries for this address. This is the block that Thread 32 (the likely culprit) is trying to acquire a lock on. Then, we’d have to check the mtr_t::m_memo of Thread 32 for the block descriptor addresses on which at least one blocked thread in btr_cur_t::search() is waiting for a lock. This should confirm the hang to be a duplicate of | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oli Sennhauser [ 2023-03-30 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Marko I used this one: https://ci.mariadb.org/33837/amd64-ubuntu-2004/mariadb-10.6.13-linux-x86_64.tar.gz After restart:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-03-30 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Oli, yes, that is the current head of the 10.6 branch. It also includes some performance fixes ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oli Sennhauser [ 2023-04-06 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Marko, It is stable so far until now. I am in vacation now. Hope it does not happen during my vacation again... | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oli Sennhauser [ 2023-04-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Marko, back from vacation and it did NOT happen any more. So I consider this issues fixed with 10.6.13. Thanks, Oli | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-04-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thank you, oli, for confirming the fix. I have the feeling that the partial fix in 10.6.12 ( |