MDEV-26516WSREP: Record locking is disabled in this thread, but the table being modified is not `mysql/wsrep_streaming_log`: `mysql/innodb_table_stats`
Closed
MDEV-10003main.range_innodb retuns a wrong number of rows in EXPLAIN
I can observe the same thing in debugger on mysql-5.6.
I am running the statement
INSERT INTO t2 VALUES (1,1),(2,2),(3,2),(4,3),(5,3);
and see:
(gdb) set $q=& table->stat_n_rows
(gdb) watch *$q
Hardware watchpoint 5: *$q
(gdb) c
Continuing.
Hardware watchpoint 5: *$q
Old value = 0
New value = 1
0x0886379d in dict_table_n_rows_inc (table=0x965cb80) at /home/psergey/dev2/mysql-5.6-ga/storage/innobase/include/dict0dict.ic:412
(gdb) c
Continuing.
Hardware watchpoint 5: *$q
Old value = 1
New value = 2
0x0886379d in dict_table_n_rows_inc (table=0x965cb80) at /home/psergey/dev2/mysql-5.6-ga/storage/innobase/include/dict0dict.ic:412
(gdb) c
Continuing.
Hardware watchpoint 5: *$q
Old value = 2
New value = 3
0x0886379d in dict_table_n_rows_inc (table=0x965cb80) at /home/psergey/dev2/mysql-5.6-ga/storage/innobase/include/dict0dict.ic:412
(gdb) c
Continuing. [Switching to Thread 0xa128bb90 (LWP 15090)]
Hardware watchpoint 5: *$q
Old value = 3
New value = 4
0x0899099d in dict_stats_update_persistent (table=0x965cb80) at /home/psergey/dev2/mysql-5.6-ga/storage/innobase/dict/dict0stats.cc:2044
(gdb) c
Continuing. [Switching to Thread 0xa4fffb90 (LWP 15137)]
Hardware watchpoint 5: *$q
Old value = 4
New value = 5
0x0886379d in dict_table_n_rows_inc (table=0x965cb80) at /home/psergey/dev2/mysql-5.6-ga/storage/innobase/include/dict0dict.ic:412
(gdb) c
Continuing.
Hardware watchpoint 5: *$q
Old value = 5
New value = 6
0x0886379d in dict_table_n_rows_inc (table=0x965cb80) at /home/psergey/dev2/mysql-5.6-ga/storage/innobase/include/dict0dict.ic:412
(gdb) c
Continuing.
At this point, the INSERT query is finished. In the client
I see "Query OK, 5 rows affected"
Note that the stats is 6. I suppose, if one gets a big enough table, the
difference can be bigger.
[Switching to Thread 0xa128bb90 (LWP 15090)]
Breakpoint 4, dict_stats_update_persistent (table=0x965cb80) at /home/psergey/dev2/mysql-5.6-ga/storage/innobase/dict/dict0stats.cc:2044
(gdb) c
Continuing.
Hardware watchpoint 5: *$q
Old value = 6
New value = 5
0x0899099d in dict_stats_update_persistent (table=0x965cb80) at /home/psergey/dev2/mysql-5.6-ga/storage/innobase/dict/dict0stats.cc:2044
(gdb)
Sergei Petrunia
added a comment - I can observe the same thing in debugger on mysql-5.6.
I am running the statement
INSERT INTO t2 VALUES (1,1),(2,2),(3,2),(4,3),(5,3);
and see:
(gdb) set $q=& table->stat_n_rows
(gdb) watch *$q
Hardware watchpoint 5: *$q
(gdb) c
Continuing.
Hardware watchpoint 5: *$q
Old value = 0
New value = 1
0x0886379d in dict_table_n_rows_inc (table=0x965cb80) at /home/psergey/dev2/mysql-5.6-ga/storage/innobase/include/dict0dict.ic:412
(gdb) c
Continuing.
Hardware watchpoint 5: *$q
Old value = 1
New value = 2
0x0886379d in dict_table_n_rows_inc (table=0x965cb80) at /home/psergey/dev2/mysql-5.6-ga/storage/innobase/include/dict0dict.ic:412
(gdb) c
Continuing.
Hardware watchpoint 5: *$q
Old value = 2
New value = 3
0x0886379d in dict_table_n_rows_inc (table=0x965cb80) at /home/psergey/dev2/mysql-5.6-ga/storage/innobase/include/dict0dict.ic:412
(gdb) c
Continuing.
[Switching to Thread 0xa128bb90 (LWP 15090)]
Hardware watchpoint 5: *$q
Old value = 3
New value = 4
0x0899099d in dict_stats_update_persistent (table=0x965cb80) at /home/psergey/dev2/mysql-5.6-ga/storage/innobase/dict/dict0stats.cc:2044
(gdb) c
Continuing.
[Switching to Thread 0xa4fffb90 (LWP 15137)]
Hardware watchpoint 5: *$q
Old value = 4
New value = 5
0x0886379d in dict_table_n_rows_inc (table=0x965cb80) at /home/psergey/dev2/mysql-5.6-ga/storage/innobase/include/dict0dict.ic:412
(gdb) c
Continuing.
Hardware watchpoint 5: *$q
Old value = 5
New value = 6
0x0886379d in dict_table_n_rows_inc (table=0x965cb80) at /home/psergey/dev2/mysql-5.6-ga/storage/innobase/include/dict0dict.ic:412
(gdb) c
Continuing.
At this point, the INSERT query is finished. In the client
I see "Query OK, 5 rows affected"
Note that the stats is 6. I suppose, if one gets a big enough table, the
difference can be bigger.
[Switching to Thread 0xa128bb90 (LWP 15090)]
Breakpoint 4, dict_stats_update_persistent (table=0x965cb80) at /home/psergey/dev2/mysql-5.6-ga/storage/innobase/dict/dict0stats.cc:2044
(gdb) c
Continuing.
Hardware watchpoint 5: *$q
Old value = 6
New value = 5
0x0899099d in dict_stats_update_persistent (table=0x965cb80) at /home/psergey/dev2/mysql-5.6-ga/storage/innobase/dict/dict0stats.cc:2044
(gdb)
Wondering why mysql-5.6 doesn't have the problem with join_outer_innodb.test...
it seems, the cause is vasil.dimov@oracle.com-20120521133620-glj6l0ntcsrz0wbl ... They added ANALYZE TABLE statements to stabilize the statistics.
Sergei Petrunia
added a comment - Wondering why mysql-5.6 doesn't have the problem with join_outer_innodb.test...
it seems, the cause is vasil.dimov@oracle.com-20120521133620-glj6l0ntcsrz0wbl ... They added ANALYZE TABLE statements to stabilize the statistics.
Marko Mäkelä
added a comment - Starting with MariaDB Server 10.6.5, we will no longer globally disable innodb_stats_persistent in all mtr tests . Instead, only a few special tests will disable statistics, adjust timeouts or whatever.
People
Sergei Petrunia
Sergei Petrunia
Votes:
0Vote for this issue
Watchers:
2Start 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":1522.3000001907349,"ttfb":218.90000009536743,"pageVisibility":"visible","entityId":24510,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"bad18269-52ca-4532-8318-40bcc764d754","navigationType":0,"readyForUser":1571.3000001907349,"redirectCount":0,"resourceLoadedEnd":2721.800000190735,"resourceLoadedStart":413.6000003814697,"resourceTiming":[{"duration":384.2999997138977,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":413.6000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":413.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":797.9000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":384.2000002861023,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":413.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":413.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":798.1000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":386.2999997138977,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":414.1000003814697,"connectEnd":414.1000003814697,"connectStart":414.1000003814697,"domainLookupEnd":414.1000003814697,"domainLookupStart":414.1000003814697,"fetchStart":414.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":414.1000003814697,"responseEnd":800.4000000953674,"responseStart":800.4000000953674,"secureConnectionStart":414.1000003814697},{"duration":516.9000000953674,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":414.30000019073486,"connectEnd":414.30000019073486,"connectStart":414.30000019073486,"domainLookupEnd":414.30000019073486,"domainLookupStart":414.30000019073486,"fetchStart":414.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":414.30000019073486,"responseEnd":931.2000002861023,"responseStart":931.2000002861023,"secureConnectionStart":414.30000019073486},{"duration":605.8000001907349,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":414.40000009536743,"connectEnd":414.40000009536743,"connectStart":414.40000009536743,"domainLookupEnd":414.40000009536743,"domainLookupStart":414.40000009536743,"fetchStart":414.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":414.40000009536743,"responseEnd":1020.2000002861023,"responseStart":1020.2000002861023,"secureConnectionStart":414.40000009536743},{"duration":696.7999997138977,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":414.6000003814697,"connectEnd":414.6000003814697,"connectStart":414.6000003814697,"domainLookupEnd":414.6000003814697,"domainLookupStart":414.6000003814697,"fetchStart":414.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":414.6000003814697,"responseEnd":1111.4000000953674,"responseStart":1111.4000000953674,"secureConnectionStart":414.6000003814697},{"duration":681,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":430.90000009536743,"connectEnd":430.90000009536743,"connectStart":430.90000009536743,"domainLookupEnd":430.90000009536743,"domainLookupStart":430.90000009536743,"fetchStart":430.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":430.90000009536743,"responseEnd":1111.9000000953674,"responseStart":1111.9000000953674,"secureConnectionStart":430.90000009536743},{"duration":681.0999999046326,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":432.6000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":432.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1113.7000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":680.4000000953674,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":432.80000019073486,"connectEnd":432.80000019073486,"connectStart":432.80000019073486,"domainLookupEnd":432.80000019073486,"domainLookupStart":432.80000019073486,"fetchStart":432.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":432.80000019073486,"responseEnd":1113.2000002861023,"responseStart":1113.2000002861023,"secureConnectionStart":432.80000019073486},{"duration":727.2000002861023,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/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":433,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":433,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1160.2000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":725.6999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/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":433.2000002861023,"connectEnd":433.2000002861023,"connectStart":433.2000002861023,"domainLookupEnd":433.2000002861023,"domainLookupStart":433.2000002861023,"fetchStart":433.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":433.2000002861023,"responseEnd":1158.9000000953674,"responseStart":1158.9000000953674,"secureConnectionStart":433.2000002861023},{"duration":2077,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":443.5,"connectEnd":443.5,"connectStart":443.5,"domainLookupEnd":443.5,"domainLookupStart":443.5,"fetchStart":443.5,"redirectEnd":0,"redirectStart":0,"requestStart":443.5,"responseEnd":2520.5,"responseStart":2520.5,"secureConnectionStart":443.5},{"duration":2022.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":498.40000009536743,"connectEnd":498.40000009536743,"connectStart":498.40000009536743,"domainLookupEnd":498.40000009536743,"domainLookupStart":498.40000009536743,"fetchStart":498.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":498.40000009536743,"responseEnd":2520.9000000953674,"responseStart":2520.9000000953674,"secureConnectionStart":498.40000009536743},{"duration":1103.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1091.3000001907349,"connectEnd":1091.3000001907349,"connectStart":1091.3000001907349,"domainLookupEnd":1091.3000001907349,"domainLookupStart":1091.3000001907349,"fetchStart":1091.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":1091.3000001907349,"responseEnd":2194.800000190735,"responseStart":2194.800000190735,"secureConnectionStart":1091.3000001907349},{"duration":1267.6999998092651,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1502.6000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1502.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":2770.300000190735,"responseStart":0,"secureConnectionStart":0},{"duration":395.90000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/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&whisper-enabled=true","startTime":2325.9000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":2325.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":2721.800000190735,"responseStart":0,"secureConnectionStart":0},{"duration":494.6000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/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&whisper-enabled=true","startTime":2327,"connectEnd":2327,"connectStart":2327,"domainLookupEnd":2327,"domainLookupStart":2327,"fetchStart":2327,"redirectEnd":0,"redirectStart":0,"requestStart":2327,"responseEnd":2821.6000003814697,"responseStart":2821.6000003814697,"secureConnectionStart":2327}],"fetchStart":1,"domainLookupStart":1,"domainLookupEnd":1,"connectStart":1,"connectEnd":1,"requestStart":38,"responseStart":219,"responseEnd":500,"domLoading":344,"domInteractive":2802,"domContentLoadedEventStart":2802,"domContentLoadedEventEnd":2877,"domComplete":3719,"loadEventStart":3719,"loadEventEnd":3720,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":2771.300000190735},{"name":"bigPipe.sidebar-id.end","time":2772.300000190735},{"name":"bigPipe.activity-panel-pipe-id.start","time":2772.5},{"name":"bigPipe.activity-panel-pipe-id.end","time":2774.2000002861023},{"name":"activityTabFullyLoaded","time":2894.9000000953674}],"measures":[],"correlationId":"60f4083e830b09","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":97,"dbReadsTimeInMs":12,"dbConnsTimeInMs":20,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
I can observe the same thing in debugger on mysql-5.6.
I am running the statement
INSERT INTO t2 VALUES (1,1),(2,2),(3,2),(4,3),(5,3);
and see:
(gdb) set $q=& table->stat_n_rows
(gdb) watch *$q
Hardware watchpoint 5: *$q
(gdb) c
Continuing.
Hardware watchpoint 5: *$q
Old value = 0
New value = 1
0x0886379d in dict_table_n_rows_inc (table=0x965cb80) at /home/psergey/dev2/mysql-5.6-ga/storage/innobase/include/dict0dict.ic:412
(gdb) c
Continuing.
Hardware watchpoint 5: *$q
Old value = 1
New value = 2
0x0886379d in dict_table_n_rows_inc (table=0x965cb80) at /home/psergey/dev2/mysql-5.6-ga/storage/innobase/include/dict0dict.ic:412
(gdb) c
Continuing.
Hardware watchpoint 5: *$q
Old value = 2
New value = 3
0x0886379d in dict_table_n_rows_inc (table=0x965cb80) at /home/psergey/dev2/mysql-5.6-ga/storage/innobase/include/dict0dict.ic:412
(gdb) c
Continuing.
[Switching to Thread 0xa128bb90 (LWP 15090)]
Hardware watchpoint 5: *$q
Old value = 3
New value = 4
0x0899099d in dict_stats_update_persistent (table=0x965cb80) at /home/psergey/dev2/mysql-5.6-ga/storage/innobase/dict/dict0stats.cc:2044
(gdb) c
Continuing.
[Switching to Thread 0xa4fffb90 (LWP 15137)]
Hardware watchpoint 5: *$q
Old value = 4
New value = 5
0x0886379d in dict_table_n_rows_inc (table=0x965cb80) at /home/psergey/dev2/mysql-5.6-ga/storage/innobase/include/dict0dict.ic:412
(gdb) c
Continuing.
Hardware watchpoint 5: *$q
Old value = 5
New value = 6
0x0886379d in dict_table_n_rows_inc (table=0x965cb80) at /home/psergey/dev2/mysql-5.6-ga/storage/innobase/include/dict0dict.ic:412
(gdb) c
Continuing.
[Switching to Thread 0xa128bb90 (LWP 15090)]
Breakpoint 4, dict_stats_update_persistent (table=0x965cb80) at /home/psergey/dev2/mysql-5.6-ga/storage/innobase/dict/dict0stats.cc:2044
(gdb) c
Continuing.
Hardware watchpoint 5: *$q
Old value = 6
New value = 5
0x0899099d in dict_stats_update_persistent (table=0x965cb80) at /home/psergey/dev2/mysql-5.6-ga/storage/innobase/dict/dict0stats.cc:2044
(gdb)