-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-33441 Do not deinit plugin variables when retry requested
After MDEV-31400, plugins are allowed to ask for retries when failing initialisation. However, such failures also cause plugin system variables to be deleted (plugin_variables_deinit()) before retrying and are not re-added during retry. We fix this by checking that if the plugin has requested a retry the variables are not deleted. Because plugin_deinitialize() also calls plugin_variables_deinit(), if the retry fails, the variables will still be deleted. Alternatives considered: - remove the plugin_variables_deinit() from plugin_initialize() error handling altogether. We decide to take a more conservative approach here. - re-add the system variables during retry. It is more complicated than simply iterating over plugin->system_vars and call my_hash_insert(). For example we will need to assign values to the test_load field and extract more code from test_plugin_options(), if that is possible.
- Loading branch information
1 parent
a0f2ff8
commit c37216d
Showing
7 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# | ||
# MDEV-33441 No spider variables available is Spider is loaded upon server startup | ||
# | ||
set spider_same_server_link=0; | ||
# | ||
# end of test mdev_33441 | ||
# |
10 changes: 10 additions & 0 deletions
10
storage/spider/mysql-test/spider/bugfix/r/mdev_33441_fail.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# | ||
# MDEV-33441 No spider variables available is Spider is loaded upon server startup | ||
# | ||
select * from mysql.plugin; | ||
name dl | ||
show variables like 'spider%'; | ||
Variable_name Value | ||
# | ||
# end of test mdev_33441_fail | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--plugin-load-add=ha_spider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--echo # | ||
--echo # MDEV-33441 No spider variables available is Spider is loaded upon server startup | ||
--echo # | ||
|
||
# We test that at least one spider variable exists. | ||
set spider_same_server_link=0; | ||
|
||
--echo # | ||
--echo # end of test mdev_33441 | ||
--echo # |
2 changes: 2 additions & 0 deletions
2
storage/spider/mysql-test/spider/bugfix/t/mdev_33441_fail.opt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--plugin-load-add=ha_spider | ||
--debug-dbug=d,fail_spider_init_retry |
10 changes: 10 additions & 0 deletions
10
storage/spider/mysql-test/spider/bugfix/t/mdev_33441_fail.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--source include/have_debug.inc | ||
--echo # | ||
--echo # MDEV-33441 No spider variables available is Spider is loaded upon server startup | ||
--echo # | ||
# We test that when retry fails, spider variables are deleted. | ||
select * from mysql.plugin; | ||
show variables like 'spider%'; | ||
--echo # | ||
--echo # end of test mdev_33441_fail | ||
--echo # |