[MDEV-19395] Server fails to crash recover after being kill -9'd with RocksDB and binlog Created: 2019-05-05 Updated: 2019-06-21 Resolved: 2019-06-21 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - RocksDB |
| Affects Version/s: | 10.2.21, 10.3.13 |
| Fix Version/s: | 10.2.26, 10.3.17, 10.3.18 |
| Type: | Bug | Priority: | Major |
| Reporter: | Anton Polyakov | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
Steps to reproduce:
Actual result:
or
Removing "log-bin" from my.cnf makes issue go away. Verified on both 10.2.21 and 10.3.13 |
| Comments |
| Comment by Sergei Petrunia [ 2019-06-03 ] | ||||||||
|
Results so far: It's easily reproducible on my machine The crash (assert) occurs when RocksDB tries to de-initialize itself after a The recovery failure happens in PessimisticTransactionDB::Initialize, in the
loop. The mentioned loop basically does this:
We fail in "real_trx->do_the_same_change" step, when we try to apply a Merge | ||||||||
| Comment by Sergei Petrunia [ 2019-06-03 ] | ||||||||
|
Fairly easy to reproduce with just two transactions:
On recovery, both transactions will try to apply the merge operation to the AUTO_INC key, and will hit an error. Stack trace:
| ||||||||
| Comment by Sergei Petrunia [ 2019-06-03 ] | ||||||||
|
The upstream doesn't hit this, because the have this patch: https://github.com/facebook/rocksdb/commit/3f5282268fc81200c305eff974f4bf912cd0de2a it allows a transaction to disable concurrency control . rocksdb::PessimisticTransaction::TryLock has this at the start :
and this is how it avoids a lock conflict | ||||||||
| Comment by Sergei Petrunia [ 2019-06-03 ] | ||||||||
|
... and that patch was fixing exactly the problem we are having:
| ||||||||
| Comment by Sergei Petrunia [ 2019-06-03 ] | ||||||||
|
Ok, so one way to fix this is to do a merge MyRocks upstream. This will include updating the RocksDB to a newer version which includes the fix. Such merges usually require some manual effort, though. A possible easier solution is to just update the RocksDB to a newer version. This might not work (RocksDB API is not 100% stable), but typically it works. | ||||||||
| Comment by Sergei Petrunia [ 2019-06-21 ] | ||||||||
|
I've merged upstream MyRocks and RocksDB into MariaDB. The merge commit is: |