Bug #108991 | util.loadDump fails if table has more than one FULLTEXT index | ||
---|---|---|---|
Submitted: | 3 Nov 2022 15:06 | Modified: | 22 Nov 2022 17:27 |
Reporter: | Duke Lee | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Shell Dump & Load | Severity: | S3 (Non-critical) |
Version: | 8.0.31 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[3 Nov 2022 15:06]
Duke Lee
[3 Nov 2022 23:53]
Duke Lee
Presumably, the error occurs because --loadIndexes defaults to true and --deferTableIndexes defaults to fulltext, the latter of which produces the error: "As of 8.0.31, MySQL Shell utilizes MySQL Server's parallel index creation. Previously, the dump loading utilities added indexes sequentially, one at a time. As of this release, all indexes in a table are added simultaneously." https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-utilities-load-dump.html#mysql-sh...
[4 Nov 2022 12:41]
MySQL Verification Team
Hi Mr. Lee, Thank you for your bug report. However, before we proceed, we would like to know whether this bug is a duplicate of the bug #108975 ??
[4 Nov 2022 15:19]
Duke Lee
Hi, This bug is not related to bug #108975. 108975 refers to an error during DDL view creation. This FULLTEXT index bug is during DDL table creation, particularly when loads are used with deferTableIndexes options. It effectively renders the option useless if there exists a table with more than one FULLTEXT index since the load process breaks with the error described above. The following causes failures: --loadIndexes=true --deferTableIndexes=fulltext (both of these values are default values) --loadIndexes=true --deferTableIndexes=all The only workaround is to NOT use this feature by turning it off: --deferTableIndexes=none
[4 Nov 2022 19:57]
Duke Lee
Correction to the above: The only workaround is to NOT use this feature by turning it off: --deferTableIndexes=off (not "none")
[7 Nov 2022 13:14]
MySQL Verification Team
Hi Mr. Lee, We would also require some data in that table in order to reproduce the behaviour.
[7 Nov 2022 16:52]
Duke Lee
If you run the above steps, it will produce the error described. Data isn't required for reproduction.
[8 Nov 2022 12:41]
MySQL Verification Team
Hi Mr. Lee, We are unable to see what is a bug that you are reporting. MySQL clearly states that only one fulltext index can be created at a time. Hence, this is intended behaviour, for the time being ......
[8 Nov 2022 15:09]
Duke Lee
"MySQL clearly states that only one fulltext index can be created at a time." Yes, you are exactly right. Did you look at the error output that I posted in original bug report? util.loadDump is trying to create _all_ FULLTEXT indexes in one ALTER statement, which, as you've said, is not allowed by mysql for fulltext indexes.
[8 Nov 2022 15:12]
Duke Lee
I'd like to make clear that the error is NOT coming from the example table DDL that I posted above. You _are_ allowed to declare multiple FULLTEXT indexes upon table creation. The error is occurring with util.loadDump due to deferTableIndexes because it's trying to add multiple FULLTEXT indexes with one ALTER statement, which is NOT allowed.
[9 Nov 2022 12:15]
MySQL Verification Team
Hi Mr. Lee, What is a bug number of the original report ????
[9 Nov 2022 15:47]
Duke Lee
I meant the original post/comment at the very top of this page. I'd like to try to make this crystal clear that this is a bug with util.loadDump: 1) User creates a table the contains 2 or more fulltext indexes (no errors thrown) 2) User dumps the data using util.dumpInstance (no errors thrown) 3) User takes the data and restores it onto a separate mysql instance (no errors thrown) 4) util.loadDump defers creation of fulltext indexes due to the default values: --loadIndexes=true --deferTableIndexes=fulltext (no errors thrown) 5) At the end of the process, util.dumpInstance tries to add the fulltext index (ERROR THROWN) The reason that step #5 fails is because util.dumpInstance is trying to add the fulltext indexes in a single ALTER statement, which we've already discussed is not legal for mysql server/innodb. Look at the error message at the very top of this page. util.loadDump is trying to run the following query: ALTER TABLE `db`.`test` ADD FULLTEXT KEY `name` (`name`),ADD FULLTEXT KEY `email` (`email`) which is not legal. util.loadDump is trying to run a query that is not legal.
[9 Nov 2022 15:50]
Duke Lee
Corrections to the above: "5) At the end of the process, util.dumpInstance tries to add the fulltext index (ERROR THROWN)" should read: "5) At the end of the process, util.loadDump tries to add the fulltext index (ERROR THROWN)" and "The reason that step #5 fails is because util.dumpInstance" should read: "The reason that step #5 fails is because util.loadDump"
[10 Nov 2022 12:57]
MySQL Verification Team
Hi Mr. Lee, Thank you for the clarifications. As far as we can see, there is nothing stopping you from doing two ALTER TABLE commands and add two FTS indices ...... However, we do understand your position. This report could be treated as a feature request and if that is OK with you, we shall change it to feature request and verify it as such.
[10 Nov 2022 15:16]
Duke Lee
Wow, I'm truly in disbelief... Let me try to clarify this again. util.loadDump has a feature controlled by the deferTableIndexes option where it will initially create tables WITHOUT indexes. This allows the data load step to run faster. After the data load, util.loadDump will then recreate indexes after the data has been loaded. util.loadDump tries to add indexes back in a SINGLE ALTER statement. I have ZERO control over what queries util.loadDump runs when recreating the fulltext indexes. I CANNOT tell util.loadDump to recreate the indexes as two separate ALTER statements. I'm not the one issuing the ALTER statement that includes multiple fulltext indexes. This statement is coming from the util.loadDump tool itself. Again, it is UTIL.LOADDUMP that is issuing the illegal ALTER statement when it is trying to recreate the indexes. I don't know why you seem to keep insisting that I'm the one that's manually issuing this illegal command. The log output that I pasted in the bug report clearly shows that the error is coming from the util.loadDump tool.
[10 Nov 2022 15:27]
MySQL Verification Team
Hi Mr. Lee, We do not insist that you should run ALTER TABLE that we all know that it will fail. Simply, there are two options. You either run two valid ALTER TABLE's or we verify this report as a feature request, so that MySQL Shell itself gets a feature to create additional 2 or more FTS indices with a single command. That is all .....
[10 Nov 2022 15:56]
MySQL Verification Team
Hi, Apologies, my colleague missed the point that this is all done by shell and not by you. Until recently when we say "shell" we were talking about something completely different. I reproduced and verified the bug. Thank you for your patience and for this report and reproducible test case. kind regards
[22 Nov 2022 17:27]
Edward Gilmore
Posted by developer: Added the following note to the MySQL Shell 8.0.32 release notes: util.loadDump failed if a table in the dump had more than one FULLTEXT index. The following error was returned: InnoDB presently supports one FULLTEXT index creation at a time As of this release, if a table contains more than one FULLTEXT index, each additional index is created using separate ALTER TABLE statements.
[23 Nov 2022 12:55]
MySQL Verification Team
Thank you, Edward.