Lag free ALTER statement breaks replication when executing binlog_alter_two_phase = 1,0 dynamically
Testcase
1) Configure async master-slave replication.
config info
|
gtid_strict_mode=1
|
log_slave_updates=ON
|
log_bin=binlog
|
binlog_format=ROW
|
master_info_repository=TABLE
|
relay_log_info_repository=TABLE
|
binlog_alter_two_phase=YES
|
2) Execute given SQLs on master server
Replication stops with the following error info.
Last_SQL_Errno: 1950
|
Last_SQL_Error: An attempt was made to binlog GTID 0-112-10 which would create an out-of-order sequence number with existing GTID 0-112-10, and gtid strict mode is enabled
|
|
2022-01-26 11:01:22 6 [Note] Slave SQL thread initialized, starting replication in log 'FIRST' at position 4, relay log './galapq-relay-bin.000001' position: 4; GTID position ''
|
2022-01-26 11:01:22 5 [Note] Slave I/O thread: connected to master 'repl@127.0.0.1:4070',replication starts at GTID position ''
|
2022-01-26 11:01:44 6 [ERROR] Slave SQL: An attempt was made to binlog GTID 0-112-10 which would create an out-of-order sequence number with existing GTID 0-112-10, and gtid strict mode is enabled, Gtid 0-112-10, Internal MariaDB error code: 1950
|
2022-01-26 11:01:44 6 [Warning] Slave: An attempt was made to binlog GTID 0-112-10 which would create an out-of-order sequence number with existing GTID 0-112-10, and gtid strict mode is enabled Error_code: 1950
|
2022-01-26 11:01:44 6 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'binlog.000001' position 1914; GTID position '0-112-9'
|
2022-01-26 11:01:44 6 [Note] Slave SQL thread exiting, replication stopped in log 'binlog.000001' at position 1914; GTID position '0-112-9', master: 127.0.0.1:4070
|
SQLs
|
CREATE TABLE t1 (a1 int, d1 int DEFAULT 0);
|
INSERT INTO t1 VALUES (1,1) ;
|
SET binlog_alter_two_phase=YES;
|
ALTER TABLE t1 WAIT 9 RENAME COLUMN a1 TO a2;
|
SET binlog_alter_two_phase=NO;
|
ALTER TABLE t1 ALTER COLUMN d1 DROP DEFAULT;
|
DROP TABLE t1;
|
- relates to
-
MDEV-11675
Lag Free Alter On Slave
-
-
Closed
{"report":{"fcp":1327.5999994277954,"ttfb":705.6999998092651,"pageVisibility":"visible","entityId":107187,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"5365f576-861d-4652-9b9e-53811440f237","navigationType":0,"readyForUser":1412.1999998092651,"redirectCount":0,"resourceLoadedEnd":1175.8999996185303,"resourceLoadedStart":712.3999996185303,"resourceTiming":[{"duration":104.80000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":712.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":712.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":817.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":104.80000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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","startTime":712.6999998092651,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":712.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":817.5,"responseStart":0,"secureConnectionStart":0},{"duration":138.29999923706055,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":712.8000001907349,"connectEnd":712.8000001907349,"connectStart":712.8000001907349,"domainLookupEnd":712.8000001907349,"domainLookupStart":712.8000001907349,"fetchStart":712.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":712.8000001907349,"responseEnd":851.0999994277954,"responseStart":851.0999994277954,"secureConnectionStart":712.8000001907349},{"duration":269.4000005722046,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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","startTime":713.0999994277954,"connectEnd":713.0999994277954,"connectStart":713.0999994277954,"domainLookupEnd":713.0999994277954,"domainLookupStart":713.0999994277954,"fetchStart":713.0999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":854.0999994277954,"responseEnd":982.5,"responseStart":869.8000001907349,"secureConnectionStart":713.0999994277954},{"duration":140,"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":713.3000001907349,"connectEnd":713.3000001907349,"connectStart":713.3000001907349,"domainLookupEnd":713.3000001907349,"domainLookupStart":713.3000001907349,"fetchStart":713.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":713.3000001907349,"responseEnd":853.3000001907349,"responseStart":853.3000001907349,"secureConnectionStart":713.3000001907349},{"duration":140.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":713.5,"connectEnd":713.5,"connectStart":713.5,"domainLookupEnd":713.5,"domainLookupStart":713.5,"fetchStart":713.5,"redirectEnd":0,"redirectStart":0,"requestStart":713.5,"responseEnd":853.8000001907349,"responseStart":853.8000001907349,"secureConnectionStart":713.5},{"duration":140.39999961853027,"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":713.8000001907349,"connectEnd":713.8000001907349,"connectStart":713.8000001907349,"domainLookupEnd":713.8000001907349,"domainLookupStart":713.8000001907349,"fetchStart":713.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":713.8000001907349,"responseEnd":854.1999998092651,"responseStart":854.1999998092651,"secureConnectionStart":713.8000001907349},{"duration":142.4000005722046,"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":714.0999994277954,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":714.0999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":856.5,"responseStart":0,"secureConnectionStart":0},{"duration":140.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":714.1999998092651,"connectEnd":714.1999998092651,"connectStart":714.1999998092651,"domainLookupEnd":714.1999998092651,"domainLookupStart":714.1999998092651,"fetchStart":714.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":714.1999998092651,"responseEnd":854.5,"responseStart":854.5,"secureConnectionStart":714.1999998092651},{"duration":142.10000038146973,"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":714.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":714.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":856.5,"responseStart":0,"secureConnectionStart":0},{"duration":140.5999994277954,"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":714.5,"connectEnd":714.5,"connectStart":714.5,"domainLookupEnd":714.5,"domainLookupStart":714.5,"fetchStart":714.5,"redirectEnd":0,"redirectStart":0,"requestStart":714.5,"responseEnd":855.0999994277954,"responseStart":855.0999994277954,"secureConnectionStart":714.5},{"duration":292.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":715.5,"connectEnd":715.5,"connectStart":715.5,"domainLookupEnd":715.5,"domainLookupStart":715.5,"fetchStart":715.5,"redirectEnd":0,"redirectStart":0,"requestStart":715.5,"responseEnd":1008.3999996185303,"responseStart":1008.3999996185303,"secureConnectionStart":715.5},{"duration":460.30000019073486,"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":715.5999994277954,"connectEnd":715.5999994277954,"connectStart":715.5999994277954,"domainLookupEnd":715.5999994277954,"domainLookupStart":715.5999994277954,"fetchStart":715.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":715.5999994277954,"responseEnd":1175.8999996185303,"responseStart":1175.8999996185303,"secureConnectionStart":715.5999994277954},{"duration":199.5999994277954,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1008.5,"connectEnd":1008.5,"connectStart":1008.5,"domainLookupEnd":1008.5,"domainLookupStart":1008.5,"fetchStart":1008.5,"redirectEnd":0,"redirectStart":0,"requestStart":1175.6999998092651,"responseEnd":1208.0999994277954,"responseStart":1206.8000001907349,"secureConnectionStart":1008.5},{"duration":248.10000038146973,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1279.8999996185303,"connectEnd":1279.8999996185303,"connectStart":1279.8999996185303,"domainLookupEnd":1279.8999996185303,"domainLookupStart":1279.8999996185303,"fetchStart":1279.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":1279.8999996185303,"responseEnd":1528,"responseStart":1528,"secureConnectionStart":1279.8999996185303}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":85,"responseStart":706,"responseEnd":707,"domLoading":710,"domInteractive":1490,"domContentLoadedEventStart":1490,"domContentLoadedEventEnd":1553,"domComplete":2066,"loadEventStart":2066,"loadEventEnd":2067,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1460.8999996185303},{"name":"bigPipe.sidebar-id.end","time":1461.6999998092651},{"name":"bigPipe.activity-panel-pipe-id.start","time":1461.8000001907349},{"name":"bigPipe.activity-panel-pipe-id.end","time":1463.3000001907349},{"name":"activityTabFullyLoaded","time":1568.8000001907349}],"measures":[],"correlationId":"69183705b806d4","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":97,"dbReadsTimeInMs":15,"dbConnsTimeInMs":22,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}