[MDEV-13739] Huge slowness at inserting rows, CPU-bound Created: 2017-09-05 Updated: 2018-07-06 |
|
| Status: | Confirmed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - RocksDB |
| Affects Version/s: | 10.2.6, 10.2.8 |
| Fix Version/s: | 10.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Julien Muchembled | Assignee: | Sergei Petrunia |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
Test case:
RocksDB:
TokuDB:
perf shows a lot of time spent in rollback, but the application does not do any explicitely
|
| Comments |
| Comment by Julien Muchembled [ 2017-09-05 ] | |||||||||||||||||||
|
The attached general log dumps the executed requests for a few seconds. The code of our software can be found at https://lab.nexedi.com/nexedi/neoppod/blob/master/neo/storage/database/mysqldb.py
In mysql_execute_command, I added prints around trans_rollback_stmt, and it is really called as many as times as there are DUP_ENTRY. At the beginning, trans_rollback_stmt is fast and then it gets slower and slower: up to 100ms. If I sum up everything, all the time is really spent there. | |||||||||||||||||||
| Comment by Andrii Nikitin (Inactive) [ 2017-09-09 ] | |||||||||||||||||||
|
I can confirm that I can easily observe problem behavior when long transaction meets many 'duplicate key' errors :
(It also worth to note that MyRocks does show even worse performance in my tests, so the problem is not specific to MariaDB .) Long transactions is not the strongest side of RocksDB engine, so it is kind of expected behavior. Did you consider to execute SQL command below (in session before import) to solve performance problem? (assuming that you understand consequences):
| |||||||||||||||||||
| Comment by Sergei Petrunia [ 2017-09-12 ] | |||||||||||||||||||
|
Also filed against upstream as https://github.com/facebook/mysql-5.6/issues/702 | |||||||||||||||||||
| Comment by Sergei Petrunia [ 2017-09-20 ] | |||||||||||||||||||
|
Did a quick investigation and posted the outcome in issue #702. It's fixable but it will take more than a few hours. | |||||||||||||||||||
| Comment by Sergei Petrunia [ 2018-04-19 ] | |||||||||||||||||||
|
Work with savepoints has been re-worked in | |||||||||||||||||||
| Comment by Otto Kekäläinen [ 2018-07-06 ] | |||||||||||||||||||
|
psergey Any updates here? |