[MDEV-11987] False "Plugin is busy and will be uninstalled on shutdown" message Created: 2017-02-03 Updated: 2017-02-06 Resolved: 2017-02-06 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Plugins |
| Affects Version/s: | 10.1.19 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Hartmut Holzgraefe | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 1 |
| Labels: | None | ||
| Environment: |
linux |
||
| Description |
|
A storage engine can easily be uninstalled as long as no open table is currently relying on that plugin. E.g. lets create a BLACKHOLE table, then uninstall the plugin right away while the table still exists. This works fine:
Doing a FLUSH TABLES after using the table and before uninstalling the plugin also works (but obviously there is potential for a race condition now):
Now lets try without FLUSH TABLES:
Fair enough. But maybe we can flush, then try UNINSTALL once more? Unfortunately not really:
Funny enough though: SHOW PLUGINS no longer shows an entry for BLACKHOLE anymore though. Now for the real problem though: I stopped the mysqld server process with mysqladmin shutdown and restarted it, and found the plugin to be alive and kicking again:
So "Plugin is busy and will be uninstalled on shutdown" turns out to be not true. This is independent of the extra FLUSH/UNINSTALL step after seeing the warning, it happens to come back from the dead in both cases. Only safe way to get rid of the plugin is to FLUSH TABLES to close all tables using it before trying to uninstall. Unfortunately there's the possibility that another connection uses the table again between FLUSH and UNINSTALL ... |
| Comments |
| Comment by Elena Stepanova [ 2017-02-03 ] | ||||||||||||||||
|
hholzgra, so, what's the bug? That it can be uninstalled? The summary seems to complain about the warning, but there is no warning in your scenario. | ||||||||||||||||
| Comment by Hartmut Holzgraefe [ 2017-02-03 ] | ||||||||||||||||
|
The main bug is that it is still there after restart even though the warning said it would be removed on shutdown | ||||||||||||||||
| Comment by Hartmut Holzgraefe [ 2017-02-03 ] | ||||||||||||||||
|
Also the "flush before uninstall" approach has a race condition. I tried to get around that with LOCK TABLES, but that again opens the tables ... next test: see if FLUSH works after having the LOCK (you may have seen an unfinished version of the text as I accidentially submitted while only having written half the text) | ||||||||||||||||
| Comment by Hartmut Holzgraefe [ 2017-02-03 ] | ||||||||||||||||
|
Can't flush while holding locks:
| ||||||||||||||||
| Comment by Hartmut Holzgraefe [ 2017-02-03 ] | ||||||||||||||||
|
No luck with FTWRL either:
| ||||||||||||||||
| Comment by Elena Stepanova [ 2017-02-03 ] | ||||||||||||||||
|
>> Funny enough though: SHOW PLUGINS no longer shows an entry for BLACKHOLE anymore though. It looks correct. The warning does not tell the whole story – it's not really about not being able to uninstall before shutdown, the plugin is "busy" because you have open tables. When you flush the tables, plugin is no longer busy and thus gets uninstalled. >> Now for the real problem though: I stopped the mysqld server process with mysqladmin shutdown and restarted it, and found the plugin to be alive and kicking again: I can't reproduce this part. Are you sure you don't have plugin-load=ha_blackhole somewhere in config? install soname 'ha_blackhole' wouldn't complain about it, so it doesn't contradict anything that we can see above, and would explain why the plugin is there after restart. | ||||||||||||||||
| Comment by Hartmut Holzgraefe [ 2017-02-03 ] | ||||||||||||||||
|
> Are you sure you don't have plugin-load=ha_blackhole somewhere in config? install soname 'ha_blackhole' wouldn't complain about it, so it doesn't contradict anything that we can see above, and would explain why the plugin is there after restart. Indeed, had that as leftover from previous tests ... Ok to close as "not a bug" |