[MDEV-29975] Assertion `m_status == DA_ERROR' failed in Diagnostics_area::sql_errno on SAVEPOINT, Got error 1, Got error 153, Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed. Created: 2022-11-08 Updated: 2023-08-02 Resolved: 2023-03-17 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Server, Storage Engine - InnoDB |
| Affects Version/s: | 10.6, 10.7, 10.8, 10.9, 10.10, 10.11 |
| Fix Version/s: | 10.11.3, 11.0.2, 10.6.13, 10.8.8, 10.9.6, 10.10.4 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Roel Van de Paar | Assignee: | Thirunarayanan Balathandayuthapani |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | regression-10.6, regression-10.7 | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Leads to (please note the differences in output 10.11 dbg vs opt and 10.6 dbg, note also different crash in 10.6 dbg only):
Crash confirmed present in: Also affected: Bug (or feature/syntax) confirmed not present in: |
| Comments |
| Comment by Roel Van de Paar [ 2022-11-08 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
(Not a recent regression; a 10.7 test build from mid March 22 crashes in the same way) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2022-11-08 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This looks similar to | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2022-11-08 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Sure it does, but I think the remarkable part here is the difference between 10.6 and 10.7+. Why is it that on 10.6+ the second INSERT ends with ER_DUP_ENTRY, while on 10.7+ it's a ER_ERROR_DURING_COMMIT? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Rucha Deodhar [ 2023-01-13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
When we execute the first SAVEPOINT a; statement, it works ok, adds the savepoint to trx_savepoints. But when we execute the second SAVEPOINT a; we try to release the already existing savepoint with the same name. To do that, it enters savepoint_release() but then it crashes with savepoint doesnt exists which seemed strange(because the savepoint with same name exists. Why would we get this error?!). On debugging more I found that savepoint gets removed during second INSERT, during trx_roll_savepoint_free(). About the second insert giving different errors on 10.6 and 10.7+ is (discussed with Thiru): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Thirunarayanan Balathandayuthapani [ 2023-01-23 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Patch is in bb-10.6- | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-01-24 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The 10.6 patch looks OK to push. It could be good to say "release the savepoint name" in the commit message, so that it cannot be mistaken with ROLLBACK TO SAVEPOINT. The 10.7 patch looks potentially risky to me, and it could be a change of behavior compared to the 10.6 version. Would the 10.6 patch work also in 10.7? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-01-24 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The 10.6 patch would require an adjustment when applied to 10.7:
I do not quite understand this test scenario. The test is executing in autocommit=1 mode, and there is no explicit START TRANSACTION or BEGIN statement. Shouldn’t the SAVEPOINT statements be disregarded (or result in a warning) when they are not being executed inside a transaction? There is no way for ROLLBACK TO SAVEPOINT to refer to them. A more valid test from the InnoDB point of view would be one where the SAVEPOINT is executed inside a transaction. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Roel Van de Paar [ 2023-03-02 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Leads to:
On optimized builds. On debug it crashes:
Confirmed the crash in 10.6-11.0 (dbg), and the error message in 10.6-11.0 (opt). 10.5 Does not look to be affected. If we remove TEMPORARY from the testcase for t2, we get:
Any non-affected version will produce (with and without TEMPORARY):
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Erlandas [ 2023-03-03 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I am getting the error: `ERROR 1180 (HY000) at line 2245: Got error 1 "Operation not permitted" during COMMIT` on trying to import mysqldump into Mariadb 10.11.2 the line 2245 has `INTO INTO plan_changes VALUES` and then values follow. The problem was caused by a duplicate entry (created on master running MariaDB 10.10.3). There is an index: Indexes and I found duplicate by running a query: ``` ``` Deleted one record on master, made dump again and I was able to import mysql dump on replica without issues. Normally, on duplicate I was getting error on other tables: ``` Duplicates somehow get created when a table has primary key + unique key and we perform 'on duplicate update' query. Not every time but about 100 duplicates found on a large table. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Roel Van de Paar [ 2023-03-04 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Erland22 FYI, you can use {noformat}...{noformat} and {code:sql}...{code} tags in JIRA instead of ```. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-03-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thank you, the 10.6 version looks good to me. The 10.8 version is a bit different due to | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-03-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The 10.8 version is different, because if there is an outstanding error noticed at the end of a statement or during the execution of XA PREPARE, we must retain the transaction as active for further error handling. We kind of roll it back while keeping the transaction active. |