[MDEV-27103] mariadb-upgrade fails with 'System table spider_tables is different version' => Can't create database 'performance_schema' Created: 2021-11-19 Updated: 2023-12-22 Resolved: 2023-12-22 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - Spider, Upgrades |
| Affects Version/s: | 10.4, 10.5, 10.6, 10.7 |
| Fix Version/s: | 10.4.33, 10.5.24, 10.6.17, 10.11.7, 11.0.5, 11.1.4, 11.2.3 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Timofey Turenko | Assignee: | Yuchen Pei |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | affects-tests | ||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
e.g. upgrade 10.2 -> latest 10.6
|
| Comments |
| Comment by Elena Stepanova [ 2021-11-21 ] | ||||||||||||||||||||||||||||||
|
My initial suspicions were wrong, it is not related to either Spider being non-stable in 10.2, or to the race condition upon mysql_upgrade. It is a plain upgrade problem. During mysql_upgrade process, the Spider errors are thrown upon dropping the performance_schema database, so the following performance_schema error is just an aftermath, it happens because DROP failed. It can be reproduced without package installation, as long as the differences in Spider setup procedure are taken into account. For example,
Or,
Affected upgrade combinations:
Oddly, upgrade from 10.4 to 10.5 is not affected, maybe it was handled in some special way. | ||||||||||||||||||||||||||||||
| Comment by Nayuta Yanagisawa (Inactive) [ 2022-02-07 ] | ||||||||||||||||||||||||||||||
|
The error, System table spider_tables is different version, is raised when the number of columns in a Spider system table is different from what is expected. I expect that the system tables are fixed once the Spider is loaded after the upgrade, but it seems not to work properly. I've not yet fully understood the problem but I guess that the upgrade from 10.4 to 10.5 or from 10.6 to 10.7 is not affected because the numbers of columns in the Spider system tables have not been changed between these versions. The Spider initialization process will be changed significantly in | ||||||||||||||||||||||||||||||
| Comment by Timofey Turenko [ 2022-06-22 ] | ||||||||||||||||||||||||||||||
|
from latest ES release upgrade tests reproducible in following situations: 10.2 -> 10.6.8 10.3 -> 10.6.8 10.5 -> 10.6.8 | ||||||||||||||||||||||||||||||
| Comment by Nayuta Yanagisawa (Inactive) [ 2022-06-27 ] | ||||||||||||||||||||||||||||||
|
elenst Do you have any idea about where Spider is loaded after the upgrade (booting a newer version ~ running mysql_upgrade)? | ||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2022-06-27 ] | ||||||||||||||||||||||||||||||
|
In both scenarios described here Spider would be first loaded dynamically (and added to mysql.plugin) by INSTALL PLUGIN on the old server version, would remain in mysql.plugin after the old version was shut down, and thus would be further loaded on server startup after the new version was started on the same datadir. | ||||||||||||||||||||||||||||||
| Comment by Yuchen Pei [ 2023-11-03 ] | ||||||||||||||||||||||||||||||
|
I'm not sure how to debug this with gdb, so I added an abort();
and here's the trace at the abort
So mysql_rm_table_no_locks() is iterating over all storage engines to So I suspect what happens is a race condition caused by the async | ||||||||||||||||||||||||||||||
| Comment by Yuchen Pei [ 2023-11-28 ] | ||||||||||||||||||||||||||||||
|
I tested the upgrade for 10.5->10.6 at the following 5b847372069 upstream/bb-10.5-mdev-29870 c5bab76559c upstream/bb-10.6-mdev-29870 | ||||||||||||||||||||||||||||||
| Comment by Yuchen Pei [ 2023-12-07 ] | ||||||||||||||||||||||||||||||
|
blocked by having | ||||||||||||||||||||||||||||||
| Comment by Yuchen Pei [ 2023-12-21 ] | ||||||||||||||||||||||||||||||
|
Now that 10.5 2b8c59fffaaf33455d2a226ecc209b5763c2b7bf I also tested the other two combinations, and here's the summary: worked: 10.5 2b8c59fffaa not working: 10.5 5b847372069 So something in current 10.6 is preventing it from working, as the Also tested on 4f091920679, which is the earliest merge to 10.6 Turned out it is caused by a recent merge not containing the correct | ||||||||||||||||||||||||||||||
| Comment by Yuchen Pei [ 2023-12-22 ] | ||||||||||||||||||||||||||||||
|
Fixed by |