I had some doubts whether this is safe to do in all cases or if some deadlocks could be caused due to making changes to some pages after a page allocation. (There is a rule about that in operations that affect the change buffer; see the comment in the function btr_compress() which BTW is involved in the deadlock that has been reported in MDEV-14637.)
It turns out that whenever there is not enough space for the undo log record in the undo log page, InnoDB will commit the mini-transaction and start a new one. It also turns out that the undo log record write would be attempted on the same page that was already written to within trx_undo_assign_undo(). So, merging the mini-transactions should be completely safe.
Marko Mäkelä
added a comment - I had some doubts whether this is safe to do in all cases or if some deadlocks could be caused due to making changes to some pages after a page allocation. (There is a rule about that in operations that affect the change buffer; see the comment in the function btr_compress() which BTW is involved in the deadlock that has been reported in MDEV-14637 .)
It turns out that whenever there is not enough space for the undo log record in the undo log page, InnoDB will commit the mini-transaction and start a new one. It also turns out that the undo log record write would be attempted on the same page that was already written to within trx_undo_assign_undo() . So, merging the mini-transactions should be completely safe.
People
Marko Mäkelä
Sergey Vojtovich
Votes:
0Vote for this issue
Watchers:
6Start 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":1486,"ttfb":324,"pageVisibility":"visible","entityId":65462,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"3dd39387-b18f-4498-ba05-ec1c4f3fc6a4","navigationType":0,"readyForUser":1556.3000001907349,"redirectCount":0,"resourceLoadedEnd":1797.4000000953674,"resourceLoadedStart":334.09999990463257,"resourceTiming":[{"duration":541.4000000953674,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":334.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":334.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":875.5,"responseStart":0,"secureConnectionStart":0},{"duration":541.5999999046326,"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":334.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":334.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":876,"responseStart":0,"secureConnectionStart":0},{"duration":605.5999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":334.7000002861023,"connectEnd":334.7000002861023,"connectStart":334.7000002861023,"domainLookupEnd":334.7000002861023,"domainLookupStart":334.7000002861023,"fetchStart":334.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":334.7000002861023,"responseEnd":940.3000001907349,"responseStart":940.3000001907349,"secureConnectionStart":334.7000002861023},{"duration":696.7000002861023,"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":335.5,"connectEnd":335.5,"connectStart":335.5,"domainLookupEnd":335.5,"domainLookupStart":335.5,"fetchStart":335.5,"redirectEnd":0,"redirectStart":0,"requestStart":335.5,"responseEnd":1032.2000002861023,"responseStart":1032.2000002861023,"secureConnectionStart":335.5},{"duration":701.0999999046326,"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":335.7000002861023,"connectEnd":335.7000002861023,"connectStart":335.7000002861023,"domainLookupEnd":335.7000002861023,"domainLookupStart":335.7000002861023,"fetchStart":335.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":335.7000002861023,"responseEnd":1036.8000001907349,"responseStart":1036.8000001907349,"secureConnectionStart":335.7000002861023},{"duration":701.4000000953674,"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":335.90000009536743,"connectEnd":335.90000009536743,"connectStart":335.90000009536743,"domainLookupEnd":335.90000009536743,"domainLookupStart":335.90000009536743,"fetchStart":335.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":335.90000009536743,"responseEnd":1037.3000001907349,"responseStart":1037.3000001907349,"secureConnectionStart":335.90000009536743},{"duration":701.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":336.09999990463257,"connectEnd":336.09999990463257,"connectStart":336.09999990463257,"domainLookupEnd":336.09999990463257,"domainLookupStart":336.09999990463257,"fetchStart":336.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":336.09999990463257,"responseEnd":1037.5999999046326,"responseStart":1037.5999999046326,"secureConnectionStart":336.09999990463257},{"duration":750.3000001907349,"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":336.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":336.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1086.7000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":701.5999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":336.5,"connectEnd":336.5,"connectStart":336.5,"domainLookupEnd":336.5,"domainLookupStart":336.5,"fetchStart":336.5,"redirectEnd":0,"redirectStart":0,"requestStart":336.5,"responseEnd":1038.0999999046326,"responseStart":1038.0999999046326,"secureConnectionStart":336.5},{"duration":750.0999999046326,"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":336.7000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":336.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1086.8000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":702,"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":336.80000019073486,"connectEnd":336.80000019073486,"connectStart":336.80000019073486,"domainLookupEnd":336.80000019073486,"domainLookupStart":336.80000019073486,"fetchStart":336.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":336.80000019073486,"responseEnd":1038.8000001907349,"responseStart":1038.8000001907349,"secureConnectionStart":336.80000019073486},{"duration":1044.0999999046326,"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":342.2000002861023,"connectEnd":342.2000002861023,"connectStart":342.2000002861023,"domainLookupEnd":342.2000002861023,"domainLookupStart":342.2000002861023,"fetchStart":342.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":342.2000002861023,"responseEnd":1386.3000001907349,"responseStart":1386.3000001907349,"secureConnectionStart":342.2000002861023},{"duration":1455.0999999046326,"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":342.30000019073486,"connectEnd":342.30000019073486,"connectStart":342.30000019073486,"domainLookupEnd":342.30000019073486,"domainLookupStart":342.30000019073486,"fetchStart":342.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":342.30000019073486,"responseEnd":1797.4000000953674,"responseStart":1797.4000000953674,"secureConnectionStart":342.30000019073486},{"duration":284,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1103.4000000953674,"connectEnd":1103.4000000953674,"connectStart":1103.4000000953674,"domainLookupEnd":1103.4000000953674,"domainLookupStart":1103.4000000953674,"fetchStart":1103.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":1103.4000000953674,"responseEnd":1387.4000000953674,"responseStart":1387.4000000953674,"secureConnectionStart":1103.4000000953674},{"duration":440,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&slack-enabled=true&whisper-enabled=true","startTime":1429,"connectEnd":1429,"connectStart":1429,"domainLookupEnd":1429,"domainLookupStart":1429,"fetchStart":1429,"redirectEnd":0,"redirectStart":0,"requestStart":1429,"responseEnd":1869,"responseStart":1869,"secureConnectionStart":1429},{"duration":423.3999996185303,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1472.7000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1472.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1896.0999999046326,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":176,"responseStart":324,"responseEnd":340,"domLoading":329,"domInteractive":1851,"domContentLoadedEventStart":1851,"domContentLoadedEventEnd":1892,"domComplete":2497,"loadEventStart":2497,"loadEventEnd":2498,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1833.9000000953674},{"name":"bigPipe.sidebar-id.end","time":1834.9000000953674},{"name":"bigPipe.activity-panel-pipe-id.start","time":1835.0999999046326},{"name":"bigPipe.activity-panel-pipe-id.end","time":1835.9000000953674},{"name":"activityTabFullyLoaded","time":1905.8000001907349}],"measures":[],"correlationId":"2b78a8fa66cdbd","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":95,"dbReadsTimeInMs":13,"dbConnsTimeInMs":22,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
I had some doubts whether this is safe to do in all cases or if some deadlocks could be caused due to making changes to some pages after a page allocation. (There is a rule about that in operations that affect the change buffer; see the comment in the function btr_compress() which BTW is involved in the deadlock that has been reported in
MDEV-14637.)It turns out that whenever there is not enough space for the undo log record in the undo log page, InnoDB will commit the mini-transaction and start a new one. It also turns out that the undo log record write would be attempted on the same page that was already written to within trx_undo_assign_undo(). So, merging the mini-transactions should be completely safe.