[MDEV-13935] INSERT INTO stuck at state "Unlocking tables" Created: 2017-09-28 Updated: 2018-12-31 Resolved: 2018-03-16 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Manipulation - Insert, Storage Engine - InnoDB |
| Affects Version/s: | 10.2.8 |
| Fix Version/s: | 10.2.14, 10.3.6 |
| Type: | Bug | Priority: | Major |
| Reporter: | Manu Anttila | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 6 |
| Labels: | hang, lock, regression, transactions | ||
| Environment: |
CentOS release 6.9 |
||
| Attachments: |
|
||||||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Description |
|
Disabling query cache and persistent stats does not help.
Inner deadlock?
|
| Comments |
| Comment by Manu Anttila [ 2017-09-28 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Upgrade to 10.2.9 did not help either. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2017-09-30 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
jplindst, could you please take a look? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Manu Anttila [ 2017-10-06 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Any ideas on this? This occurs every time in our multiuser tests. We are using 10.2.9. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2017-10-10 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
So it is waiting asyncronous rollback to finish and I see also log fsync on other thread, but do not see any errors on error log. There is few simple inserts and then insert into select, is that a huge table? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by YURII KANTONISTOV [ 2017-11-08 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
From the latest occurrence looks like worker-thread which hanged on INSERT keeps running in infinite loop: │1548 /** else if (loop_count < 1000) { │1570 /* 1 millisecond */ │1571 sleep_time = 1000; │1572 }else { │1573 /* 100 milliseconds */ │1574 sleep_time = 100000; │1575 }│1576 (gdb) p/x trx->in_innodb Does this mean that trx->in_innodb erroneusly dropped below zero value at some point? Attached call stack, trx and thd prints - mysqld_hanged_20171108.txt. fsync() mentioned in earlier comment gets back from OS with ret=0, as there innodb_buffer_pool_instances=64 fsyncs called quite frequently. Notice - transaction which hanged did not have failed SQLs, at least visible to the client, this is what we see from our application log: "START TRANSACTION" at Wed Nov 08 16:52:50 2017 this one is hanging ===> UPDATE module SET mstate=3 WHERE module.nid = 1 AND module.unnr = 74 AND module.mpos = 19 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by YURII KANTONISTOV [ 2017-11-09 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
After 10 hours worker thread in the same loop inside TrxInInnoDB::wait: (gdb) p loop_count Looks like this condition is always evaluated to true causing infinite loop: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by YURII KANTONISTOV [ 2017-11-24 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
In the latest bug occurrence have seen that same transaction context variable was accessed by two worker threads simultaneously (threads 25 and 12). Checked that these two threads were handling different connections and different transactions, however they clash often on the same InnoDB tables doing a lot of selects and updates/inserts/deletes. Somehow this situation ends up in a wrong decrement in thread 25: Breakpoint 1 at 0x5586b5469e38: file /coriant/mariadb/10.2.10/storage/innobase/include/trx0trx.h, line 1532. if (- trx_mutex_enter(trx); (gdb) thr 25 next operation - trx->in_innodb 0 => 0xffffffff Attached backtraces from these threads taken from gdb session, same transaction context (trx=0x7f61594df418) seen on both stacks - see gdb_mysqld_20171123.txt Maybe trx->in_depth variable increment/decrement isn't protected/non-atomic and thus is the subject to race conditions=>root cause for this and similar bugs? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alex [ 2017-12-13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Probably related to MDEV-14336 (Deadlock at unlocking tables when local server and replication write to same table). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Michael Love [ 2017-12-13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I believe I'm experiencing the same issue. I'm developing a multi-threaded program were up to a dozen worker threads perform inserts & update on a table that can grow as large as 23 million rows, but tends to happen within the first hundred-thousand or so inserts/updates. Testing with 10.2.8 to 10.2.11, I encounter hangs like this, but not with 10.0 or 10.1 (the current dev environment). I've been searching and trying to debug this for a couple of months, and have also tried the query cache & stats workaround, but nothing has helped. We would like to switch to 10.2 so we can make use of the JSON functions, but for now this is preventing us from switching from 10.1. Please let me know if I can provide any debugging output that might help. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ali Borhani [ 2017-12-22 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
We face this issue every day after upgrading from 10.1 to 10.2. And because of using InnoDB row locking (`for update`) we have 20-30 records every day which are not accessible until we restart the database by killing the process of `mysqld`. (just running `systemctl restart mysql` doesn't work, we have to kill the process too. BTW `kill <thread-id>` doesn't work too, the state is changed to Killed but the thread/process is still running) Also, we face the issue Alex said almost once in a week and I think it's related to this issue too. Because the queries are the same. This issue has become a serious issue for us. How can I help you to fix this issue sooner? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Michael Love [ 2017-12-28 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I just ran my tests three times with MySQL 5.7.20 and it ran without issue, so whatever is going on is specific to MariaDB 10.2. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Michael Love [ 2017-12-30 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
My tests are also showing that this problem is present under MariaDB 10.3.3. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Vahid Ashrafian [ 2018-01-21 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Any update on this issue? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Michael Love [ 2018-02-22 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I am now unable to replicate my particular issue after the release of 10.2.13. I think this has been fixed by I didn't create this issue, so I cannot speak for the original author, but if we were both experiencing the same issue, this should be fixed for the others who have posted here as well. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ali Borhani [ 2018-02-25 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
After updating to 10.2.13, we still face this issue (However, it's an update query, not an insert query). Also, we have some update, insert and even select queries stuck in state 'NULL' too and we can't kill them. (Maybe it's related to the issue MDEV-15217) As I said before, because of using pessimistic locking (FOR UPDATE), the records won't be accessible until we restart the database. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Manu Anttila [ 2018-03-07 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
After updating to 10.2.13, we still face this issue as well. It is now an update query stuck in state 'query end'. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by YURII KANTONISTOV [ 2018-03-07 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Yeps, here is more details from latest occurrence - mysqld_10_2_13_hanged_spid_65.zip Again spinning in the infinite loop here: Thread 12 (Thread 0x7fe6c4b0f700 (LWP 4424)): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Julius [ 2018-03-07 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
After upgrading from MariaDB 2.10.6 to 2.10.13 we started experiencing this issue. INSERT queries getting stuck in state Unlocking tables. We had one case of UPDATE query getting stuck in init state it might or might not be the same issue. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ali Borhani [ 2018-03-07 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@YURII KANTONISTOV, comparing to Percona and Mysql source codes, the file "storage/innobase/include/trx0trx.h" is a little bit different: MariaDB 10.2.13 - https://github.com/MariaDB/server/blob/mariadb-10.2.13/storage/innobase/include/trx0trx.h#L1496
Percona 5.7 - https://github.com/percona/percona-server/blob/5.7/storage/innobase/include/trx0trx.h#L1465
Mysql 5.7 - https://github.com/mysql/mysql-server/blob/5.7/storage/innobase/include/trx0trx.h#L1431
I'm not familiar with MariaDB/MySQL/Percona source codes, but can these differences cause this/these issue(s)? In addition, we also have queries stuck in "query end" and "init" states too. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by YURII KANTONISTOV [ 2018-03-08 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
If this will be of any help - some time ago we patched TrxInInnoDB::exit to get our internal testing done, see below, then hanging did not occur. But this is just an ugly workaround, I believe real bug is somewhere else: ut_ad((trx->in_innodb & TRX_FORCE_ROLLBACK_MASK) > 0); => ut_ad((trx->in_innodb & TRX_FORCE_ROLLBACK_MASK) > 0); else { --trx->in_innodb; } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2018-03-09 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
As far as I can tell, the TRX_FORCE_ROLLBACK_MASK is dead code in MariaDB 10.2. The reason is that unlike MySQL 5.7, MariaDB 10.2 does not implement the function thd_tx_priority() or the field THD::thd_tx_priority. Because in MariaDB 10.2 thd_trx_priority() always returns 0, also trx_is_high_priority() will always return false and DeadlockChecker::select_victim() will never invoke trx_arbitrate(). jplindst, please explain how you think that reverting this code cleanup that was done as part of Wouldn’t it make more sense to remove the dead code altogether? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2018-03-10 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
In fact, the field trx_t::in_depth should be unnecessary in MariaDB. It was added in MySQL 5.7.6 as part of WL#6835: InnoDB: GCS Replication: Deterministic Deadlock Handling (High Prio Transactions in InnoDB), which is Oracle’s response to Galera multi-master replication. Also the class TrxInInnoDB was added as part of WL#6835, in MySQL 5.7.5 already. I think that the proper fix should be to carefully revert all WL#6835 code from MariaDB. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2018-03-10 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This appears to be the merge of WL#6835 to MySQL 5.7.6 (5,485 lines of diff to the first parent; 3,570 lines of that in InnoDB code). There are many follow-up fixes, but it might be easiest to try to revert the initial merge and resolve the conflicts. This could also lead to the right track regarding this hang. Reverting this merge would remove the fields trx_t::in_depth and trx_t::in_innodb and the class TrxInInnoDB. I have the feeling that this instrumentation is very unforgiving and fragile. Maybe some rare code paths were not adjusted when this code was merged to MariaDB 10.2.2 in the first place? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2018-03-11 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I wonder if the hangs could be due to two other changes:
To rule out the former, I would suggest testing with innodb_lock_schedule_algorithm=fcfs. As always, if InnoDB hangs, without having stack traces of all threads (thread apply all backtrace from gdb) it is very difficult to guess what is going on. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2018-03-11 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
It looks like innodb_lock_schedule_algorithm=vats would corrupt the lock data structures when lock_rec_insert_by_trx_age() is invoked on a lock on a SPATIAL INDEX. It seems that it can only deal with B-tree indexes. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ali Borhani [ 2018-03-11 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
We've already tested it, it didn't work. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2018-03-11 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I pushed a revert of WL#6835 and some other cleanup to bb-10.2-marko. This will require thorough testing and review. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2018-03-12 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
marko My intention was not to push that change to 10.2 but my staging branch instead. There is at least one stack on this issue and that is not in VATS code instead it is spinning on trx0trx.h in wait() function. I have been trying to repeat with rqg but failed | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2018-03-12 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The TrxInInnoDB::wait() as well as the whole TrxInInnoDB and a lot of related code were removed in my patch. I had to push a follow-up fix to unbreak the build. Surprisingly, there are no related-looking test failures on buildbot so far. But, this would have to be tested very carefully, and especially the changes in lock0lock.cc would have to be reviewed thoroughly. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2018-03-13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
When comparing the lock0lock.cc code to MySQL 5.7, I found some potential hang sources, such as the lock_grant() that was changed by the innodb_lock_schedule_algorithm=VATS patch. I will push a revised set of commits to bb-10.2-marko shortly. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2018-03-16 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I have now pushed this to 10.2. Some WSREP related cleanup I pushed to 10.1. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ali Borhani [ 2018-04-02 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Since we've updated to 10.2.14, we haven't faced this issue. Also, the average response time of our endpoints is decreased by 100-150%. Thank you all | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Manu Anttila [ 2018-04-06 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
10.2.14 has solved the issue. Thank you very much. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Fernando Mattera [ 2018-06-27 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
We faced the same issue, but Galera | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2018-06-28 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
matteraf, Galera is using InnoDB underneath, and the InnoDB in MariaDB Server contains some related modifications (WSREP patches, for write-set replication). Most of the Galera-related changes in InnoDB have something to do with record locking. So yes, it looks like you were affected by exactly this issue. The hang was caused by new code that was introduced in MySQL 5.7 (and merged to MariaDB 10.2) for Galera-like functionality in MySQL 5.7. This code was mostly dead code, because some related callback functions were replaced with stubs in MariaDB. So, it was safe to revert those changes. The hang was caused by something in the class TrxInInnoDB that was part of the added 5.7 code. I did not study the exact mechanism. Now that the unnecessary 5.7 code has been removed from MariaDB, it is safe to say that this hang is not possible any more. |