The loading of the spider plugin causes a background thread to be created and the set of sql in storage/spider/spd_init_query.h to be run.
Running mysql_upgrade at the same time the initialization of spider is occurring can cause problems as MDEV-27068 shows.
One of the conflicts was
ALTER TABLE proc MODIFY
and spiders' {{ drop procedure}}
Other similar conflicts can occur on plugin and udf function installation
MDEV-19275 sql service for plugins means 10.7+ can simply this. Is it valid during initialization? Not 100% sure, but if it is, it would avoid the mariadb-upgrade conflicts.
Other simplifications are:
spider_fix_one_table looks like a simple modification of the ALTER TABLE syntax to use the column IF NOT EXISTS syntax of https://mariadb.com/kb/en/alter-table/ would negate the need for this function.
mysql.spider_fix_system_tables, a procedure with zero arguments that sets user variables could be inline. Or better, removed and use the executable comment syntax in https://mariadb.com/kb/en/comment-syntax/#executable-comment-syntax to run statements based on the server version.
Can the following be implemented another way install plugin [spider_rewrite soname 'ha_spider' (INSTALL PLUGIN has IF NOT EXISTS from 10.4)
Can the udf functions created another way?
Is there are reason (all of) this couldn't be part of mysql-upgrade? wrapped under conditional upgrade if spider is installed?
Attachments
Issue Links
is blocked by
MDEV-27107prevent two mariadb-upgrade running in parallel
Closed
is part of
MDEV-22979"mysqld --bootstrap" / mysql_install_db hangs when Spider is installed
Closed
relates to
MDEV-19842Crash while creating statistics for Spider table
Closed
MDEV-27998Delete spider_table_crd_thread_count and spider_table_sts_thread_count
Stalled
MDEV-28553Spider: clean up plugin initialization SQLs in spd_init_query.h
Open
MDEV-32804Remove the (unimplemented and unused) spider_rewrite_plugin
Closed
MDEV-14622Running mysql_upgrade in background upon package installation or upgrade causes deadlocks and other side-effects
Thanks for the comment serg. As with the discussions at #spider, after refining on the first idea above, I think it is worth trying to re-interpret plugin-load-add=ha_spider as a "internal" file containing install soname ha_spider;. Here is a PoC: https://github.com/MariaDB/server/commit/603a4c218b7
This way we can get rid of the bg thread completely. It also means we can decouple the present issue from MDEV-22979 and MDEV-27233 as by the time of executing the init queries in the internal file it will have all it needs. A clean-up of the queries is still useful though.
Yuchen Pei
added a comment - - edited Thanks for the comment serg . As with the discussions at #spider, after refining on the first idea above, I think it is worth trying to re-interpret plugin-load-add=ha_spider as a "internal" file containing install soname ha_spider; . Here is a PoC: https://github.com/MariaDB/server/commit/603a4c218b7
This way we can get rid of the bg thread completely. It also means we can decouple the present issue from MDEV-22979 and MDEV-27233 as by the time of executing the init queries in the internal file it will have all it needs. A clean-up of the queries is still useful though.
The commit to fix the init bugs MDEV-22979MDEV-27233 will be based on these ones
Yuchen Pei
added a comment - Hi holyfoot , PTAL thanks:
https://github.com/MariaDB/server/commit/27f33965ef0
https://github.com/MariaDB/server/commit/cb0e0c915f6
The commit to fix the init bugs MDEV-22979 MDEV-27233 will be based on these ones
FOUND 3 /\[Note\] Loading of SPIDER[a-zA-Z0-9_]* from ha_spider(|.so|.dll) is deferred to a temporary init file/ in mysqld.1.1.err
select * from mysql.plugin;
name dl
create table t (c int) Engine=SPIDER;
# restart
FOUND 6 /\[Note\] Loading of SPIDER[a-zA-Z0-9_]* from ha_spider(|.so|.dll) is deferred to a temporary init file/ in mysqld.1.1.err
drop table t;
Yuchen Pei
added a comment - - edited I wrote a testcase with plugin-load-add=ha_spider in a .cnf file, and each time the server starts, spider gets loaded fine:
# ~/source/mariadb-server/mdev-22979/src/storage/spider/mysql-test/spider/bugfix/t/plugin_load_add_repeatedly.test
--echo #
--echo # plugin-load-add=ha_spider
--echo #
--let SEARCH_PATTERN=\\[Note\\] Loading of SPIDER[a-zA-Z0-9_]* from ha_spider(|.so|.dll) is deferred to a temporary init file
--let SEARCH_FILE=`select regexp_replace(@@tmpdir, '^.*/','')`
--let SEARCH_FILE=$MYSQLTEST_VARDIR/log/$SEARCH_FILE.err
--source include/search_pattern_in_file.inc
select * from mysql.plugin;
create table t (c int) Engine=SPIDER;
--source include/restart_mysqld.inc
--source include/search_pattern_in_file.inc
drop table t;
# ~/source/mariadb-server/mdev-22979/src/storage/spider/mysql-test/spider/bugfix/t/plugin_load_add_repeatedly.cnf
[mysqld.1.1]
plugin-load-add=ha_spider.so
# the test result:
#
# plugin-load-add=ha_spider
#
FOUND 3 /\[Note\] Loading of SPIDER[a-zA-Z0-9_]* from ha_spider(|.so|.dll) is deferred to a temporary init file/ in mysqld.1.1.err
select * from mysql.plugin;
name dl
create table t (c int) Engine=SPIDER;
# restart
FOUND 6 /\[Note\] Loading of SPIDER[a-zA-Z0-9_]* from ha_spider(|.so|.dll) is deferred to a temporary init file/ in mysqld.1.1.err
drop table t;
Thanks holyfoot. Yes we can consider this as part of MDEV-22979 as
some of the patches there are named after this ticket. Marking as
blocked by that ticket.
Updates on 2023-10-06: close as duplicate to MDEV-22979.
Yuchen Pei
added a comment - - edited Thanks holyfoot . Yes we can consider this as part of MDEV-22979 as
some of the patches there are named after this ticket. Marking as
blocked by that ticket.
Updates on 2023-10-06: close as duplicate to MDEV-22979 .
People
Yuchen Pei
Daniel Black
Votes:
1Vote for this issue
Watchers:
10Start watching this issue
Dates
Created:
Updated:
Resolved:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":755.2000007629395,"ttfb":221.4000005722046,"pageVisibility":"visible","entityId":105463,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"aa3fec14-800b-4a1c-a7da-96e54c422398","navigationType":0,"readyForUser":834,"redirectCount":0,"resourceLoadedEnd":904.8000001907349,"resourceLoadedStart":228.20000076293945,"resourceTiming":[{"duration":8.09999942779541,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":228.20000076293945,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":228.20000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":236.30000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":8.100000381469727,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":228.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":228.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":236.60000038146973,"responseStart":0,"secureConnectionStart":0},{"duration":69.89999961853027,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":228.70000076293945,"connectEnd":228.70000076293945,"connectStart":228.70000076293945,"domainLookupEnd":228.70000076293945,"domainLookupStart":228.70000076293945,"fetchStart":228.70000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":228.70000076293945,"responseEnd":298.6000003814697,"responseStart":298.6000003814697,"secureConnectionStart":228.70000076293945},{"duration":131,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":228.9000005722046,"connectEnd":228.9000005722046,"connectStart":228.9000005722046,"domainLookupEnd":228.9000005722046,"domainLookupStart":228.9000005722046,"fetchStart":228.9000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":228.9000005722046,"responseEnd":359.9000005722046,"responseStart":359.9000005722046,"secureConnectionStart":228.9000005722046},{"duration":134.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":229.20000076293945,"connectEnd":229.20000076293945,"connectStart":229.20000076293945,"domainLookupEnd":229.20000076293945,"domainLookupStart":229.20000076293945,"fetchStart":229.20000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":229.20000076293945,"responseEnd":363.9000005722046,"responseStart":363.9000005722046,"secureConnectionStart":229.20000076293945},{"duration":134.89999961853027,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":229.4000005722046,"connectEnd":229.4000005722046,"connectStart":229.4000005722046,"domainLookupEnd":229.4000005722046,"domainLookupStart":229.4000005722046,"fetchStart":229.4000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":229.4000005722046,"responseEnd":364.30000019073486,"responseStart":364.30000019073486,"secureConnectionStart":229.4000005722046},{"duration":135.20000076293945,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":229.5,"connectEnd":229.5,"connectStart":229.5,"domainLookupEnd":229.5,"domainLookupStart":229.5,"fetchStart":229.5,"redirectEnd":0,"redirectStart":0,"requestStart":229.5,"responseEnd":364.70000076293945,"responseStart":364.70000076293945,"secureConnectionStart":229.5},{"duration":211.79999923706055,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":229.70000076293945,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":229.70000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":441.5,"responseStart":0,"secureConnectionStart":0},{"duration":135.4000005722046,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":229.80000019073486,"connectEnd":229.80000019073486,"connectStart":229.80000019073486,"domainLookupEnd":229.80000019073486,"domainLookupStart":229.80000019073486,"fetchStart":229.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":229.80000019073486,"responseEnd":365.20000076293945,"responseStart":365.20000076293945,"secureConnectionStart":229.80000019073486},{"duration":211.60000038146973,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":230,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":230,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":441.6000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":135.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":230.10000038146973,"connectEnd":230.10000038146973,"connectStart":230.10000038146973,"domainLookupEnd":230.10000038146973,"domainLookupStart":230.10000038146973,"fetchStart":230.10000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":230.10000038146973,"responseEnd":365.9000005722046,"responseStart":365.9000005722046,"secureConnectionStart":230.10000038146973},{"duration":361.0999994277954,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":231.70000076293945,"connectEnd":231.70000076293945,"connectStart":231.70000076293945,"domainLookupEnd":231.70000076293945,"domainLookupStart":231.70000076293945,"fetchStart":231.70000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":231.70000076293945,"responseEnd":592.8000001907349,"responseStart":592.8000001907349,"secureConnectionStart":231.70000076293945},{"duration":357.3999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":236.20000076293945,"connectEnd":236.20000076293945,"connectStart":236.20000076293945,"domainLookupEnd":236.20000076293945,"domainLookupStart":236.20000076293945,"fetchStart":236.20000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":236.20000076293945,"responseEnd":593.6000003814697,"responseStart":593.6000003814697,"secureConnectionStart":236.20000076293945},{"duration":73.19999980926514,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":453.20000076293945,"connectEnd":453.20000076293945,"connectStart":453.20000076293945,"domainLookupEnd":453.20000076293945,"domainLookupStart":453.20000076293945,"fetchStart":453.20000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":453.20000076293945,"responseEnd":526.4000005722046,"responseStart":526.4000005722046,"secureConnectionStart":453.20000076293945},{"duration":195.19999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2bu7/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":709.6000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":709.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":904.8000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":179.0999994277954,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":710.4000005722046,"connectEnd":710.4000005722046,"connectStart":710.4000005722046,"domainLookupEnd":710.4000005722046,"domainLookupStart":710.4000005722046,"fetchStart":710.4000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":710.4000005722046,"responseEnd":889.5,"responseStart":889.5,"secureConnectionStart":710.4000005722046},{"duration":183.39999961853027,"initiatorType":"script","name":"https://jira.mariadb.org/s/f51ef5507eea4c158f257c66c93b2a3f-CDN/lu2bu7/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":710.9000005722046,"connectEnd":710.9000005722046,"connectStart":710.9000005722046,"domainLookupEnd":710.9000005722046,"domainLookupStart":710.9000005722046,"fetchStart":710.9000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":710.9000005722046,"responseEnd":894.3000001907349,"responseStart":894.3000001907349,"secureConnectionStart":710.9000005722046},{"duration":185.0999994277954,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":748.9000005722046,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":748.9000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":934,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":34,"responseStart":222,"responseEnd":227,"domLoading":226,"domInteractive":949,"domContentLoadedEventStart":949,"domContentLoadedEventEnd":1007,"domComplete":1088,"loadEventStart":1088,"loadEventEnd":1089,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":908.7000007629395},{"name":"bigPipe.sidebar-id.end","time":909.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":909.6000003814697},{"name":"bigPipe.activity-panel-pipe-id.end","time":912.3000001907349},{"name":"activityTabFullyLoaded","time":1033.8000001907349}],"measures":[],"correlationId":"6d8a3a28f67634","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":132,"dbReadsTimeInMs":27,"dbConnsTimeInMs":38,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Thanks for the comment serg. As with the discussions at #spider, after refining on the first idea above, I think it is worth trying to re-interpret plugin-load-add=ha_spider as a "internal" file containing install soname ha_spider;. Here is a PoC: https://github.com/MariaDB/server/commit/603a4c218b7
This way we can get rid of the bg thread completely. It also means we can decouple the present issue from
MDEV-22979andMDEV-27233as by the time of executing the init queries in the internal file it will have all it needs. A clean-up of the queries is still useful though.