mleich reproduced the following assertion failure while testing MDEV-35494:
10.6-MDEV-35049 877d75a8f49ef4170fc701b091d4303ab788d440
|
mariadbd: /data/Server/10.6-MDEV-35049/storage/innobase/buf/buf0dblwr.cc:366: void buf_dblwr_t::recover(): Assertion `recv_sys.scanned_lsn < max_lsn + 32 * 512U' failed.
|
The assertion fails, because recv_sys.scanned_lsn is 0x4109 bytes ahead of recv_sys.recovered_lsn. The limit would be 0x4000 bytes, or the maximum value of innodb_log_write_ahead_size.
At the time the server was killed before this recovery attempt, it was in the middle of a log write during the commit of a native ALTER TABLE operation:
10.6-MDEV-35049 877d75a8f49ef4170fc701b091d4303ab788d440
|
#0 __libc_pwrite64 (fd=0x7, buf=0x40f46152b000, count=0x64a00, offset=0x26df600) at ../sysdeps/unix/sysv/linux/pwrite64.c:24
|
#1 0x000064f2fbbd72c0 in SyncFileIO::execute (this=this@entry=0x2e6104922bf0, request=@0x2e6104922bd0: {bpage = 0x0, slot = 0x0, node = 0x0, type = IORequest::WRITE_SYNC})
|
at /data/Server/10.6-MDEV-35049/storage/innobase/os/os0file.cc:691
|
#2 0x000064f2fbbd8387 in os_file_io (in_type=@0x64f2fc2e81a0: {bpage = 0x0, slot = 0x0, node = 0x0, type = IORequest::WRITE_SYNC}, file=file@entry=0x7, buf=buf@entry=0x40f46152b000, n=n@entry=0x64a00,
|
offset=offset@entry=0x26df600, err=err@entry=0x2e6104922e4c) at /data/Server/10.6-MDEV-35049/storage/innobase/os/os0file.cc:2787
|
#3 0x000064f2fbbd8514 in os_file_pwrite (type=@0x64f2fc2e81a0: {bpage = 0x0, slot = 0x0, node = 0x0, type = IORequest::WRITE_SYNC}, file=file@entry=0x7, buf=buf@entry=0x40f46152b000 "\200\r6\371\002",
|
n=0x64a00, offset=0x26df600, err=err@entry=0x2e6104922e4c) at /data/Server/10.6-MDEV-35049/storage/innobase/os/os0file.cc:2862
|
#4 0x000064f2fbbd876a in os_file_write_func (type=@0x64f2fc2e81a0: {bpage = 0x0, slot = 0x0, node = 0x0, type = IORequest::WRITE_SYNC}, name=<optimized out>, file=0x7, buf=0x40f46152b000,
|
offset=<optimized out>, n=<optimized out>) at /data/Server/10.6-MDEV-35049/storage/innobase/os/os0file.cc:2891
|
#5 0x000064f2fbba4c42 in file_os_io::write (this=<optimized out>, path=<optimized out>, offset=<optimized out>, buf=<optimized out>) at /data/Server/10.6-MDEV-35049/storage/innobase/log/log0log.cc:289
|
#6 0x000064f2fbba4eb4 in log_file_t::write (this=this@entry=0x64f2fd248360 <log_sys+544>, offset=offset@entry=0x26df600, buf={data_ = 0x40f46152b000 "\200\r6\371\002", size_ = 0x64a00})
|
at /data/Server/10.6-MDEV-35049/storage/innobase/log/log0log.cc:352
|
#7 0x000064f2fbba5f0b in log_t::file::write (this=this@entry=0x64f2fd248340 <log_sys+512>, offset=offset@entry=0x26df600, buf={data_ = 0x40f46152b000 "\200\r6\371\002", size_ = 0x64a00})
|
at /data/Server/10.6-MDEV-35049/storage/innobase/log/log0log.cc:403
|
#8 0x000064f2fbba62e0 in log_write_buf (buf=buf@entry=0x40f46152b000 "\200\r6\371\002", len=len@entry=0x64a00, pad_len=pad_len@entry=0x200, start_lsn=0x1a6df000, new_data_offset=new_data_offset@entry=0xd6)
|
at /data/Server/10.6-MDEV-35049/storage/innobase/log/log0log.cc:521
|
#9 0x000064f2fbba64bc in log_write (rotate_key=rotate_key@entry=0x0) at /data/Server/10.6-MDEV-35049/storage/innobase/log/log0log.cc:662
|
#10 0x000064f2fbba6b42 in log_write_and_flush () at /data/Server/10.6-MDEV-35049/storage/innobase/log/log0log.cc:782
|
...
|
Of the 0x64a00-byte write request, only 0x14a00 had reached the ib_logfile0. The log_sys.lsn at the time of the SIGKILL is 0x1a743662-0x1a6ef8f6 = 0x53d6c bytes ahead of the recv_sys.recovered_lsn.
The failing debug assertion in the 10.6 branch is too strict. The tolerance needs to be RECV_PARSING_BUF_SIZE, that is, the maximum size of a mini-transaction, or 2 megabytes.
Note: This bug only affects the 10.6 branch. In later maintained branches, MDEV-14425 removed the log block parser, and the two recv_sys.recovered_lsn and recv_sys.scanned_lsn were merged to one recv_sys.lsn.
{"report":{"fcp":907.1999998092651,"ttfb":270.19999980926514,"pageVisibility":"visible","entityId":131984,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"8b9fc1c1-efcc-4338-ac12-12bd485c2407","navigationType":0,"readyForUser":977.0999999046326,"redirectCount":0,"resourceLoadedEnd":539.3999996185303,"resourceLoadedStart":278.8999996185303,"resourceTiming":[{"duration":37.60000038146973,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":278.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":278.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":316.5,"responseStart":0,"secureConnectionStart":0},{"duration":38.5,"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":279.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":279.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":317.69999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":180.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":279.5,"connectEnd":279.5,"connectStart":279.5,"domainLookupEnd":279.5,"domainLookupStart":279.5,"fetchStart":279.5,"redirectEnd":0,"redirectStart":0,"requestStart":325,"responseEnd":459.59999990463257,"responseStart":344.19999980926514,"secureConnectionStart":279.5},{"duration":234,"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":280,"connectEnd":280,"connectStart":280,"domainLookupEnd":280,"domainLookupStart":280,"fetchStart":280,"redirectEnd":0,"redirectStart":0,"requestStart":324.2999997138977,"responseEnd":514,"responseStart":339.8999996185303,"secureConnectionStart":280},{"duration":69.90000009536743,"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":280.19999980926514,"connectEnd":280.19999980926514,"connectStart":280.19999980926514,"domainLookupEnd":280.19999980926514,"domainLookupStart":280.19999980926514,"fetchStart":280.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":325.2999997138977,"responseEnd":350.09999990463257,"responseStart":346.3999996185303,"secureConnectionStart":280.19999980926514},{"duration":74.2000002861023,"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":280.3999996185303,"connectEnd":280.3999996185303,"connectStart":280.3999996185303,"domainLookupEnd":280.3999996185303,"domainLookupStart":280.3999996185303,"fetchStart":280.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":326,"responseEnd":354.59999990463257,"responseStart":350.7999997138977,"secureConnectionStart":280.3999996185303},{"duration":69.90000009536743,"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":280.59999990463257,"connectEnd":280.59999990463257,"connectStart":280.59999990463257,"domainLookupEnd":280.59999990463257,"domainLookupStart":280.59999990463257,"fetchStart":280.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":325.59999990463257,"responseEnd":350.5,"responseStart":348.2999997138977,"secureConnectionStart":280.59999990463257},{"duration":42.19999980926514,"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":280.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":280.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":322.8999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":74.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":280.8999996185303,"connectEnd":280.8999996185303,"connectStart":280.8999996185303,"domainLookupEnd":280.8999996185303,"domainLookupStart":280.8999996185303,"fetchStart":280.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":329.3999996185303,"responseEnd":355.7999997138977,"responseStart":352.5,"secureConnectionStart":280.8999996185303},{"duration":43.09999990463257,"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":281,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":281,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":324.09999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":83.19999980926514,"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":281.19999980926514,"connectEnd":281.19999980926514,"connectStart":281.19999980926514,"domainLookupEnd":281.19999980926514,"domainLookupStart":281.19999980926514,"fetchStart":281.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":330.09999990463257,"responseEnd":364.3999996185303,"responseStart":362.7999997138977,"secureConnectionStart":281.19999980926514},{"duration":254.09999990463257,"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":284.2999997138977,"connectEnd":284.2999997138977,"connectStart":284.2999997138977,"domainLookupEnd":284.2999997138977,"domainLookupStart":284.2999997138977,"fetchStart":284.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":357.5,"responseEnd":538.3999996185303,"responseStart":531.6999998092651,"secureConnectionStart":284.2999997138977},{"duration":255,"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":284.3999996185303,"connectEnd":284.3999996185303,"connectStart":284.3999996185303,"domainLookupEnd":284.3999996185303,"domainLookupStart":284.3999996185303,"fetchStart":284.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":435.19999980926514,"responseEnd":539.3999996185303,"responseStart":534.7999997138977,"secureConnectionStart":284.3999996185303},{"duration":211.90000009536743,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":668.6999998092651,"connectEnd":668.6999998092651,"connectStart":668.6999998092651,"domainLookupEnd":668.6999998092651,"domainLookupStart":668.6999998092651,"fetchStart":668.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":845.8999996185303,"responseEnd":880.5999999046326,"responseStart":878.5999999046326,"secureConnectionStart":668.6999998092651}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":85,"responseStart":270,"responseEnd":283,"domLoading":273,"domInteractive":1035,"domContentLoadedEventStart":1035,"domContentLoadedEventEnd":1073,"domComplete":1703,"loadEventStart":1703,"loadEventEnd":1703,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1015.3999996185303},{"name":"bigPipe.sidebar-id.end","time":1016.2999997138977},{"name":"bigPipe.activity-panel-pipe-id.start","time":1016.3999996185303},{"name":"bigPipe.activity-panel-pipe-id.end","time":1017.6999998092651},{"name":"activityTabFullyLoaded","time":1088.6999998092651}],"measures":[],"correlationId":"88dcd546d54f7","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":105,"dbReadsTimeInMs":16,"dbConnsTimeInMs":26,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Would the following patch (adjusting this assertion expression) pass the test scenario?
diff --git a/storage/innobase/buf/buf0dblwr.cc b/storage/innobase/buf/buf0dblwr.cc
index 31036bf978d..35da1780102 100644
--- a/storage/innobase/buf/buf0dblwr.cc
+++ b/storage/innobase/buf/buf0dblwr.cc
@@ -363,7 +363,7 @@ void buf_dblwr_t::recover()
innodb_log_write_ahead_size. After MDEV-14425 eliminated
OS_FILE_LOG_BLOCK_SIZE, these two LSN must be equal. */
ut_ad(recv_sys.scanned_lsn >= max_lsn);
- ut_ad(recv_sys.scanned_lsn < max_lsn + 32 * OS_FILE_LOG_BLOCK_SIZE);
+ ut_ad(recv_sys.scanned_lsn < max_lsn + RECV_PARSING_BUF_SIZE);
uint32_t page_no_dblwr= 0;