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":1027.6999998092651,"ttfb":253.7999997138977,"pageVisibility":"visible","entityId":24510,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"9aed69b6-c979-41a3-a212-792388cc4ed5","navigationType":0,"readyForUser":1095.8999996185303,"redirectCount":0,"resourceLoadedEnd":982.5999999046326,"resourceLoadedStart":260.59999990463257,"resourceTiming":[{"duration":123.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":260.59999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":260.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":384.09999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":123.7999997138977,"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":261,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":261,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":384.7999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":231.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":261.19999980926514,"connectEnd":261.19999980926514,"connectStart":261.19999980926514,"domainLookupEnd":261.19999980926514,"domainLookupStart":261.19999980926514,"fetchStart":261.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":388.2999997138977,"responseEnd":492.69999980926514,"responseStart":400.19999980926514,"secureConnectionStart":261.19999980926514},{"duration":455.7999997138977,"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":261.5,"connectEnd":261.5,"connectStart":261.5,"domainLookupEnd":261.5,"domainLookupStart":261.5,"fetchStart":261.5,"redirectEnd":0,"redirectStart":0,"requestStart":387.5,"responseEnd":717.2999997138977,"responseStart":407.69999980926514,"secureConnectionStart":261.5},{"duration":145.69999980926514,"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":261.69999980926514,"connectEnd":261.69999980926514,"connectStart":261.69999980926514,"domainLookupEnd":261.69999980926514,"domainLookupStart":261.69999980926514,"fetchStart":261.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":390.09999990463257,"responseEnd":407.3999996185303,"responseStart":406.19999980926514,"secureConnectionStart":261.69999980926514},{"duration":148.30000019073486,"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":261.8999996185303,"connectEnd":261.8999996185303,"connectStart":261.8999996185303,"domainLookupEnd":261.8999996185303,"domainLookupStart":261.8999996185303,"fetchStart":261.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":391.7999997138977,"responseEnd":410.19999980926514,"responseStart":408.3999996185303,"secureConnectionStart":261.8999996185303},{"duration":151.40000009536743,"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":262.09999990463257,"connectEnd":262.09999990463257,"connectStart":262.09999990463257,"domainLookupEnd":262.09999990463257,"domainLookupStart":262.09999990463257,"fetchStart":262.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":392.09999990463257,"responseEnd":413.5,"responseStart":410.8999996185303,"secureConnectionStart":262.09999990463257},{"duration":127.5,"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":262.2999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":262.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":389.7999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":150.2999997138977,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":262.59999990463257,"connectEnd":262.59999990463257,"connectStart":262.59999990463257,"domainLookupEnd":262.59999990463257,"domainLookupStart":262.59999990463257,"fetchStart":262.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":392.8999996185303,"responseEnd":412.8999996185303,"responseStart":410.2999997138977,"secureConnectionStart":262.59999990463257},{"duration":129.59999990463257,"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":262.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":262.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":392.2999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":151.90000009536743,"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":262.8999996185303,"connectEnd":262.8999996185303,"connectStart":262.8999996185303,"domainLookupEnd":262.8999996185303,"domainLookupStart":262.8999996185303,"fetchStart":262.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":395.2999997138977,"responseEnd":414.7999997138977,"responseStart":412,"secureConnectionStart":262.8999996185303},{"duration":474.8999996185303,"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":264,"connectEnd":264,"connectStart":264,"domainLookupEnd":264,"domainLookupStart":264,"fetchStart":264,"redirectEnd":0,"redirectStart":0,"requestStart":560.5,"responseEnd":738.8999996185303,"responseStart":738,"secureConnectionStart":264},{"duration":718.4000000953674,"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":264.19999980926514,"connectEnd":264.19999980926514,"connectStart":264.19999980926514,"domainLookupEnd":264.19999980926514,"domainLookupStart":264.19999980926514,"fetchStart":264.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":964.5999999046326,"responseEnd":982.5999999046326,"responseStart":981.3999996185303,"secureConnectionStart":264.19999980926514},{"duration":406.59999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":625.5999999046326,"connectEnd":625.5999999046326,"connectStart":625.5999999046326,"domainLookupEnd":625.5999999046326,"domainLookupStart":625.5999999046326,"fetchStart":625.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":992.6999998092651,"responseEnd":1032.1999998092651,"responseStart":1026.8999996185303,"secureConnectionStart":625.5999999046326}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":63,"responseStart":254,"responseEnd":258,"domLoading":258,"domInteractive":1213,"domContentLoadedEventStart":1213,"domContentLoadedEventEnd":1274,"domComplete":2549,"loadEventStart":2549,"loadEventEnd":2550,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1184.8999996185303},{"name":"bigPipe.sidebar-id.end","time":1185.6999998092651},{"name":"bigPipe.activity-panel-pipe-id.start","time":1185.8999996185303},{"name":"bigPipe.activity-panel-pipe-id.end","time":1187.5999999046326},{"name":"activityTabFullyLoaded","time":1294.6999998092651}],"measures":[],"correlationId":"6a6adf97a8038d","effectiveType":"4g","downlink":9.6,"rtt":0,"serverDuration":103,"dbReadsTimeInMs":16,"dbConnsTimeInMs":24,"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)