[MDEV-19114] gcol.innodb_virtual_debug failed in buildbot with Assertion `n_fields > 0' failure Created: 2019-04-01 Updated: 2020-06-04 Resolved: 2020-05-19 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB, Tests |
| Affects Version/s: | 10.2.16, 10.3.8, 10.4.0, 10.5.0 |
| Fix Version/s: | 10.5.4, 10.2.33, 10.3.24, 10.4.14 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
|
| Comments |
| Comment by Elena Stepanova [ 2019-09-07 ] | |||||||||||||||||||||||||||||||||||
|
On 10.2 05b35cf4c1cc11f2078ebf0a16a1aa82: | |||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2019-11-03 ] | |||||||||||||||||||||||||||||||||||
|
Also observed in concurrent tests on 10.4:
| |||||||||||||||||||||||||||||||||||
| Comment by Aleksey Midenkov [ 2020-04-04 ] | |||||||||||||||||||||||||||||||||||
|
10.5: http://buildbot.askmonty.org/buildbot/builders/win32-debug/builds/16745/steps/test/logs/stdio
| |||||||||||||||||||||||||||||||||||
| Comment by Eugene Kosov (Inactive) [ 2020-05-19 ] | |||||||||||||||||||||||||||||||||||
|
n_fields == 0 comes from:
| |||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2020-05-19 ] | |||||||||||||||||||||||||||||||||||
|
The n_fields assignment was moved in It may feel strange that purge is operating on an uncommitted secondary index, but it must be so by design, because concurrent DML must update a completely created secondary index as if the change had already been committed. Only duplicate key errors must be reported by the not-yet-committed DDL transaction, leading to a rollback of the operation. In the case of this failure, no concurrent DML is involved, though. The index is created by the following at event 119954:
At event 120108 we cleared the n_fields from 3 to 0, because we flagged an error (most likely, a unique key violation). The assignment is only needed for avoiding a duplicated execution of dict_col_t::detach() on indexed virtual columns. It was originally added in I will try to find a better solution, which could involve resetting dict_field_t::col to NULL in dict_index_t::detach_columns(). | |||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2020-05-19 ] | |||||||||||||||||||||||||||||||||||
|
mleich, please test bb-10.2-marko with CREATE UNIQUE INDEX on virtual columns (expecting duplicate key errors) and avoiding not only table rebuilds, but also add/drop virtual column. The fix passed my local ASAN test. | |||||||||||||||||||||||||||||||||||
| Comment by Matthias Leich [ 2020-05-19 ] | |||||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2020-05-19 ] | |||||||||||||||||||||||||||||||||||
|
This bug is not limited to virtual columns, and it is not an innocent test failure. It could affect any user of ALTER TABLE…ADD [UNIQUE] INDEX or CREATE [UNIQUE] INDEX when the operation is rolled back due to MDL upgrade timeout or duplicate key error. | |||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2020-05-20 ] | |||||||||||||||||||||||||||||||||||
|
I got yet another crash on INSERT after a failed ADD UNIQUE INDEX on a virtual column, when merging this to 10.5. So, I pushed a follow-up fix. For some reason, I was unable to reproduce that crash on 10.4. The crash occurred every now and then for the following snippet of gcol.innodb_virtual_basic:
|