Type:
Bug
Priority:
Major
Resolution:
Fixed
Affects Version/s:
10.2(EOL) , 10.3(EOL) , 10.4(EOL) , 10.5 , 10.6 , 10.7(EOL) , 10.8(EOL) , 10.9(EOL)
The function log_checkpoint() or log_checkpoint_low() tries to avoid redundant writes. Here is the 10.3 version of log_checkpoint() :
if (oldest_lsn
> log_sys.last_checkpoint_lsn + SIZE_OF_MLOG_CHECKPOINT) {
/* Some log has been written since the previous checkpoint. */
} else if (srv_shutdown_state > SRV_SHUTDOWN_INITIATED) {
/* MariaDB 10.3 startup expects the redo log file to be
logically empty (not even containing a MLOG_CHECKPOINT record)
after a clean shutdown. Perform an extra checkpoint at
shutdown. */
} else {
/* Do nothing, because nothing was logged (other than
a MLOG_CHECKPOINT marker) since the previous checkpoint. */
log_mutex_exit();
return ( true );
}
...
if (fil_names_clear(flush_lsn, do_write)) {
This logic fails to take two things into account:
The function fil_names_clear() may write some file names before the checkpoint record.
Before MDEV-14425 , the checkpoint record may be interrupted by 4+12 or 8+12 bytes of log block trailer and header.
In either case, the difference of oldest_lsn and log_sys.last_checkpoint_lsn could be more than the size of the checkpoint record.
The simplest way to fix this could be to avoid writing a new checkpoint if oldest_lsn did not change since the previous checkpoint.
relates to
MDEV-24845
Oddities around innodb_fatal_semaphore_wait_threshold and global.innodb_disallow_writes
Closed
Marko Mäkelä
made changes -
2022-03-28 15:14
Status
Open
[ 1
]
In Progress
[ 3
]
Marko Mäkelä
made changes -
2022-03-30 04:57
issue.field.resolutiondate
2022-03-30 04:57:50.0
2022-03-30 04:57:50.728
Marko Mäkelä
made changes -
2022-03-30 04:57
Fix Version/s
10.5.16
[ 27508
]
Fix Version/s
10.6.8
[ 27506
]
Fix Version/s
10.7.4
[ 27504
]
Fix Version/s
10.3
[ 22126
]
Fix Version/s
10.4
[ 22408
]
Fix Version/s
10.5
[ 23123
]
Fix Version/s
10.6
[ 24028
]
Fix Version/s
10.7
[ 24805
]
Fix Version/s
10.8
[ 26121
]
Fix Version/s
10.9
[ 26905
]
Resolution
Fixed
[ 1
]
Status
In Progress
[ 3
]
Closed
[ 6
]
Rob Schwyzer (Inactive)
made changes -
2024-04-04 22:00
Remote Link
This issue links to "Page (MariaDB Confluence)"
[ 36749
]
Rob Schwyzer (Inactive)
made changes -
2024-04-05 18:34
Remote Link
This issue links to "Page (MariaDB Confluence)"
[ 36749
]
{"report":{"fcp":1007.6000000238419,"ttfb":268.6999999284744,"pageVisibility":"visible","entityId":109257,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"4ad773ab-cb75-468e-ba04-d9d103135dbe","navigationType":0,"readyForUser":1073.5,"redirectCount":0,"resourceLoadedEnd":1116.5,"resourceLoadedStart":275.60000002384186,"resourceTiming":[{"duration":77.59999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":275.60000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":275.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":353.1999999284744,"responseStart":0,"secureConnectionStart":0},{"duration":77.80000007152557,"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":275.7999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":275.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":353.60000002384186,"responseStart":0,"secureConnectionStart":0},{"duration":149.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":276,"connectEnd":276,"connectStart":276,"domainLookupEnd":276,"domainLookupStart":276,"fetchStart":276,"redirectEnd":0,"redirectStart":0,"requestStart":276,"responseEnd":425.5,"responseStart":425.5,"secureConnectionStart":276},{"duration":300.90000009536743,"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":276.1999999284744,"connectEnd":276.1999999284744,"connectStart":276.1999999284744,"domainLookupEnd":276.1999999284744,"domainLookupStart":276.1999999284744,"fetchStart":276.1999999284744,"redirectEnd":0,"redirectStart":0,"requestStart":276.1999999284744,"responseEnd":577.1000000238419,"responseStart":577.1000000238419,"secureConnectionStart":276.1999999284744},{"duration":316.89999997615814,"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":276.39999997615814,"connectEnd":276.39999997615814,"connectStart":276.39999997615814,"domainLookupEnd":276.39999997615814,"domainLookupStart":276.39999997615814,"fetchStart":276.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":276.39999997615814,"responseEnd":593.2999999523163,"responseStart":593.2999999523163,"secureConnectionStart":276.39999997615814},{"duration":317.1999999284744,"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":276.60000002384186,"connectEnd":276.60000002384186,"connectStart":276.60000002384186,"domainLookupEnd":276.60000002384186,"domainLookupStart":276.60000002384186,"fetchStart":276.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":276.60000002384186,"responseEnd":593.7999999523163,"responseStart":593.7999999523163,"secureConnectionStart":276.60000002384186},{"duration":317.5,"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":276.7999999523163,"connectEnd":276.7999999523163,"connectStart":276.7999999523163,"domainLookupEnd":276.7999999523163,"domainLookupStart":276.7999999523163,"fetchStart":276.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":276.7999999523163,"responseEnd":594.2999999523163,"responseStart":594.2999999523163,"secureConnectionStart":276.7999999523163},{"duration":323.39999997615814,"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":276.89999997615814,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":276.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":600.2999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":318.2999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":277.10000002384186,"connectEnd":277.10000002384186,"connectStart":277.10000002384186,"domainLookupEnd":277.10000002384186,"domainLookupStart":277.10000002384186,"fetchStart":277.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":277.10000002384186,"responseEnd":595.3999999761581,"responseStart":595.3999999761581,"secureConnectionStart":277.10000002384186},{"duration":323.3000000715256,"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":277.2999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":277.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":600.6000000238419,"responseStart":0,"secureConnectionStart":0},{"duration":318.7000000476837,"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":277.39999997615814,"connectEnd":277.39999997615814,"connectStart":277.39999997615814,"domainLookupEnd":277.39999997615814,"domainLookupStart":277.39999997615814,"fetchStart":277.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":277.39999997615814,"responseEnd":596.1000000238419,"responseStart":596.1000000238419,"secureConnectionStart":277.39999997615814},{"duration":479,"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":278.1999999284744,"connectEnd":278.1999999284744,"connectStart":278.1999999284744,"domainLookupEnd":278.1999999284744,"domainLookupStart":278.1999999284744,"fetchStart":278.1999999284744,"redirectEnd":0,"redirectStart":0,"requestStart":278.1999999284744,"responseEnd":757.1999999284744,"responseStart":757.1999999284744,"secureConnectionStart":278.1999999284744},{"duration":727.2000000476837,"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":278.2999999523163,"connectEnd":278.2999999523163,"connectStart":278.2999999523163,"domainLookupEnd":278.2999999523163,"domainLookupStart":278.2999999523163,"fetchStart":278.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":278.2999999523163,"responseEnd":1005.5,"responseStart":1005.5,"secureConnectionStart":278.2999999523163},{"duration":143.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":614.1000000238419,"connectEnd":614.1000000238419,"connectStart":614.1000000238419,"domainLookupEnd":614.1000000238419,"domainLookupStart":614.1000000238419,"fetchStart":614.1000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":614.1000000238419,"responseEnd":757.6000000238419,"responseStart":757.6000000238419,"secureConnectionStart":614.1000000238419},{"duration":187.39999997615814,"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":929.1000000238419,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":929.1000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1116.5,"responseStart":0,"secureConnectionStart":0},{"duration":76.69999992847443,"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":930.1000000238419,"connectEnd":930.1000000238419,"connectStart":930.1000000238419,"domainLookupEnd":930.1000000238419,"domainLookupStart":930.1000000238419,"fetchStart":930.1000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":930.1000000238419,"responseEnd":1006.7999999523163,"responseStart":1006.6999999284744,"secureConnectionStart":930.1000000238419},{"duration":101.29999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/097ae97cb8fbec7d6ea4bbb1f26955b9-CDN/lu2cib/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&whisper-enabled=true","startTime":930.5,"connectEnd":930.5,"connectStart":930.5,"domainLookupEnd":930.5,"domainLookupStart":930.5,"fetchStart":930.5,"redirectEnd":0,"redirectStart":0,"requestStart":930.5,"responseEnd":1031.7999999523163,"responseStart":1031.7999999523163,"secureConnectionStart":930.5},{"duration":218.90000009536743,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":982.6999999284744,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":982.6999999284744,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1201.6000000238419,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":75,"responseStart":269,"responseEnd":272,"domLoading":272,"domInteractive":1246,"domContentLoadedEventStart":1246,"domContentLoadedEventEnd":1322,"domComplete":2087,"loadEventStart":2087,"loadEventEnd":2088,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1202.8999999761581},{"name":"bigPipe.sidebar-id.end","time":1203.6999999284744},{"name":"bigPipe.activity-panel-pipe-id.start","time":1203.8999999761581},{"name":"bigPipe.activity-panel-pipe-id.end","time":1208.6000000238419},{"name":"activityTabFullyLoaded","time":1398.8999999761581}],"measures":[],"correlationId":"140683c49d7dcc","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":134,"dbReadsTimeInMs":26,"dbConnsTimeInMs":37,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
My attempt at introducing a log_sys.last_checkpoint_last_lsn field did not work. It could incorrectly cause log_checkpoint() to be skipped, if all log had been durably written during a previous flushing batch, but some pages had not been flushed. We should also memorize the previous end_lsn for that to work. This was revealed by the test innodb.innodb_bug34300.
A simpler fix is to just check if the previous checkpoint only wrote a FILE_CHECKPOINT record, and skip the checkpoint in that case only. And skip it even if the record spanned two 512-byte log blocks. This fix was already implemented in
MDEV-14425for 10.8 and later.