Type:
Task
Priority:
Critical
Resolution:
Fixed
The purpose of this task is to ensure that CREATE TRIGGER is atomic
When a trigger is created, we first create a trigger_name.TRN file and then
create or update the table_name.TRG files.
This is done by creating .TRN~ and .TRG~ files and replacing (or creating)
the result files.
The new logic is
Log CREATE TRIGGER to DDL log, with a marker if old trigger existsted
If old .TRN or .TRG files exists, make backup copies of these
Create the new .TRN and .TRG files as before
Remove the backups
Crash recovery
If query has been logged to binary log:
delete any left over backup files
else
Delete any old .TRN~ or .TRG~ files
If there was orignally some triggers (old .TRG file existed)
If we crashed before creating all backup files
Delete existing backup files
else
Restore backup files
end
Delete .TRN and .TRG file (as there was no triggers before
One benefit of the new code is that CREATE OR REPLACE TRIGGER is now
totally atomic even if there existed an old trigger: Either the old
trigger will be replaced or the old one will be left untouched.
{"report":{"fcp":1698.9000000953674,"ttfb":386.40000009536743,"pageVisibility":"visible","entityId":96461,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"b49b524e-9c33-4022-bc9c-4eb25cb392c4","navigationType":0,"readyForUser":1779.4000000953674,"redirectCount":0,"resourceLoadedEnd":2169.7000000476837,"resourceLoadedStart":392.2000000476837,"resourceTiming":[{"duration":770.2999999523163,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":392.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":392.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1162.5,"responseStart":0,"secureConnectionStart":0},{"duration":770.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":392.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":392.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1162.9000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":779.0999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":392.60000014305115,"connectEnd":392.60000014305115,"connectStart":392.60000014305115,"domainLookupEnd":392.60000014305115,"domainLookupStart":392.60000014305115,"fetchStart":392.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":392.60000014305115,"responseEnd":1171.7000000476837,"responseStart":1171.7000000476837,"secureConnectionStart":392.60000014305115},{"duration":829.3000001907349,"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":392.7999999523163,"connectEnd":392.7999999523163,"connectStart":392.7999999523163,"domainLookupEnd":392.7999999523163,"domainLookupStart":392.7999999523163,"fetchStart":392.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":392.7999999523163,"responseEnd":1222.1000001430511,"responseStart":1222.1000001430511,"secureConnectionStart":392.7999999523163},{"duration":833.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":393.10000014305115,"connectEnd":393.10000014305115,"connectStart":393.10000014305115,"domainLookupEnd":393.10000014305115,"domainLookupStart":393.10000014305115,"fetchStart":393.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":393.10000014305115,"responseEnd":1226.2000000476837,"responseStart":1226.2000000476837,"secureConnectionStart":393.10000014305115},{"duration":833.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":393.2999999523163,"connectEnd":393.2999999523163,"connectStart":393.2999999523163,"domainLookupEnd":393.2999999523163,"domainLookupStart":393.2999999523163,"fetchStart":393.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":393.2999999523163,"responseEnd":1226.7000000476837,"responseStart":1226.7000000476837,"secureConnectionStart":393.2999999523163},{"duration":833.6000001430511,"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":393.5,"connectEnd":393.5,"connectStart":393.5,"domainLookupEnd":393.5,"domainLookupStart":393.5,"fetchStart":393.5,"redirectEnd":0,"redirectStart":0,"requestStart":393.5,"responseEnd":1227.1000001430511,"responseStart":1227.1000001430511,"secureConnectionStart":393.5},{"duration":929.1999998092651,"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":393.60000014305115,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":393.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1322.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":833.7000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":393.7999999523163,"connectEnd":393.7999999523163,"connectStart":393.7999999523163,"domainLookupEnd":393.7999999523163,"domainLookupStart":393.7999999523163,"fetchStart":393.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":393.7999999523163,"responseEnd":1227.5,"responseStart":1227.5,"secureConnectionStart":393.7999999523163},{"duration":929,"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":394,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":394,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1323,"responseStart":0,"secureConnectionStart":0},{"duration":834.0999999046326,"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":394.10000014305115,"connectEnd":394.10000014305115,"connectStart":394.10000014305115,"domainLookupEnd":394.10000014305115,"domainLookupStart":394.10000014305115,"fetchStart":394.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":394.10000014305115,"responseEnd":1228.2000000476837,"responseStart":1228.2000000476837,"secureConnectionStart":394.10000014305115},{"duration":1069.9000000953674,"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":395,"connectEnd":395,"connectStart":395,"domainLookupEnd":395,"domainLookupStart":395,"fetchStart":395,"redirectEnd":0,"redirectStart":0,"requestStart":395,"responseEnd":1464.9000000953674,"responseStart":1464.7999999523163,"secureConnectionStart":395},{"duration":1753.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":395.10000014305115,"connectEnd":395.10000014305115,"connectStart":395.10000014305115,"domainLookupEnd":395.10000014305115,"domainLookupStart":395.10000014305115,"fetchStart":395.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":395.10000014305115,"responseEnd":2148.2000000476837,"responseStart":2148.2000000476837,"secureConnectionStart":395.10000014305115},{"duration":180.10000014305115,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1335.5,"connectEnd":1335.5,"connectStart":1335.5,"domainLookupEnd":1335.5,"domainLookupStart":1335.5,"fetchStart":1335.5,"redirectEnd":0,"redirectStart":0,"requestStart":1335.5,"responseEnd":1515.6000001430511,"responseStart":1515.6000001430511,"secureConnectionStart":1335.5},{"duration":527.0999999046326,"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":1642.6000001430511,"connectEnd":1642.6000001430511,"connectStart":1642.6000001430511,"domainLookupEnd":1642.6000001430511,"domainLookupStart":1642.6000001430511,"fetchStart":1642.6000001430511,"redirectEnd":0,"redirectStart":0,"requestStart":1642.6000001430511,"responseEnd":2169.7000000476837,"responseStart":2169.7000000476837,"secureConnectionStart":1642.6000001430511},{"duration":516,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1686.1000001430511,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1686.1000001430511,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":2202.100000143051,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":219,"responseStart":386,"responseEnd":389,"domLoading":389,"domInteractive":2204,"domContentLoadedEventStart":2204,"domContentLoadedEventEnd":2245,"domComplete":3135,"loadEventStart":3135,"loadEventEnd":3135,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":2190.9000000953674},{"name":"bigPipe.sidebar-id.end","time":2191.7000000476837},{"name":"bigPipe.activity-panel-pipe-id.start","time":2191.9000000953674},{"name":"bigPipe.activity-panel-pipe-id.end","time":2192.7999999523163},{"name":"activityTabFullyLoaded","time":2260.7000000476837}],"measures":[],"correlationId":"ac968bda00c590","effectiveType":"4g","downlink":9.1,"rtt":0,"serverDuration":107,"dbReadsTimeInMs":10,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Pushed into bb-10.6-monty