[MDEV-15733] Crash during Spider-related CREATE TABLE/ALTER TABLE can leave orphaned entry in mysql.spider_tables Created: 2018-03-29 Updated: 2021-11-05 Resolved: 2018-05-08 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - Spider |
| Affects Version/s: | 10.2.13 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Geoff Montee (Inactive) | Assignee: | Jacob Mathew (Inactive) |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | spider | ||
| Description |
|
If MariaDB crashes during a CREATE TABLE/ALTER TABLE statement that either creates a new spider table or converts an existing table to use the spider engine, then there can be orphaned entries in mysql.spider_tables that reference the spider table that was never actually created. At that point, if the user tries to recreate the table again, then they run into an error that is difficult to understand: e.g. if they run this CREATE TABLE statement:
Then they would see the following error:
To workaround the problem, the orphaned row needs to be deleted:
And then the table can be created. To fix this, maybe Spider should do some kind of validation at server startup, like making sure that all rows listed in mysql.spider_tables reference tables that actually exist? |
| Comments |
| Comment by Jacob Mathew (Inactive) [ 2018-05-08 ] |
|
I am unable to reproduce the issue. I have tried with 10.2.13, 10.2.15, 10.2.4 and 10.3.7, with debug and release builds, on Windows 10 and CentOS 7. |
| Comment by Philippe Jean [ 2021-11-05 ] |
|
I just had this problem in Galera cluster mode. The problem is that a DROP TABLE on table with Spider engine had to drop the row in mysql.spider_tables locally only, not on other nodes. I've done some testing and it doesn't happen regularly. |