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":1221.8000001907349,"ttfb":306.5999994277954,"pageVisibility":"visible","entityId":107187,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"99c1ac04-fce4-4a04-bf2f-4260f5b7c3a3","navigationType":0,"readyForUser":1320.3999996185303,"redirectCount":0,"resourceLoadedEnd":1505,"resourceLoadedStart":312.69999980926514,"resourceTiming":[{"duration":414.80000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":312.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":312.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":727.5,"responseStart":0,"secureConnectionStart":0},{"duration":414.70000076293945,"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":313.0999994277954,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":313.0999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":727.8000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":424.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":313.19999980926514,"connectEnd":313.19999980926514,"connectStart":313.19999980926514,"domainLookupEnd":313.19999980926514,"domainLookupStart":313.19999980926514,"fetchStart":313.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":313.19999980926514,"responseEnd":737.3999996185303,"responseStart":737.3999996185303,"secureConnectionStart":313.19999980926514},{"duration":490.69999980926514,"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":313.3999996185303,"connectEnd":313.3999996185303,"connectStart":313.3999996185303,"domainLookupEnd":313.3999996185303,"domainLookupStart":313.3999996185303,"fetchStart":313.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":313.3999996185303,"responseEnd":804.0999994277954,"responseStart":804.0999994277954,"secureConnectionStart":313.3999996185303},{"duration":494.69999980926514,"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":313.69999980926514,"connectEnd":313.69999980926514,"connectStart":313.69999980926514,"domainLookupEnd":313.69999980926514,"domainLookupStart":313.69999980926514,"fetchStart":313.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":313.69999980926514,"responseEnd":808.3999996185303,"responseStart":808.3999996185303,"secureConnectionStart":313.69999980926514},{"duration":495,"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":313.8999996185303,"connectEnd":313.8999996185303,"connectStart":313.8999996185303,"domainLookupEnd":313.8999996185303,"domainLookupStart":313.8999996185303,"fetchStart":313.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":313.8999996185303,"responseEnd":808.8999996185303,"responseStart":808.8999996185303,"secureConnectionStart":313.8999996185303},{"duration":495.1000003814697,"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":314.0999994277954,"connectEnd":314.0999994277954,"connectStart":314.0999994277954,"domainLookupEnd":314.0999994277954,"domainLookupStart":314.0999994277954,"fetchStart":314.0999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":314.0999994277954,"responseEnd":809.1999998092651,"responseStart":809.1999998092651,"secureConnectionStart":314.0999994277954},{"duration":575,"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":314.30000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":314.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":889.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":495.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":314.3999996185303,"connectEnd":314.3999996185303,"connectStart":314.3999996185303,"domainLookupEnd":314.3999996185303,"domainLookupStart":314.3999996185303,"fetchStart":314.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":314.3999996185303,"responseEnd":809.6999998092651,"responseStart":809.6999998092651,"secureConnectionStart":314.3999996185303},{"duration":574.9000005722046,"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":314.5999994277954,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":314.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":889.5,"responseStart":0,"secureConnectionStart":0},{"duration":495.6000003814697,"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":314.69999980926514,"connectEnd":314.69999980926514,"connectStart":314.69999980926514,"domainLookupEnd":314.69999980926514,"domainLookupStart":314.69999980926514,"fetchStart":314.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":314.69999980926514,"responseEnd":810.3000001907349,"responseStart":810.3000001907349,"secureConnectionStart":314.69999980926514},{"duration":1078.1999998092651,"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":315.69999980926514,"connectEnd":315.69999980926514,"connectStart":315.69999980926514,"domainLookupEnd":315.69999980926514,"domainLookupStart":315.69999980926514,"fetchStart":315.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":315.69999980926514,"responseEnd":1393.8999996185303,"responseStart":1393.8999996185303,"secureConnectionStart":315.69999980926514},{"duration":1189.3000001907349,"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":315.69999980926514,"connectEnd":315.69999980926514,"connectStart":315.69999980926514,"domainLookupEnd":315.69999980926514,"domainLookupStart":315.69999980926514,"fetchStart":315.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":315.69999980926514,"responseEnd":1505,"responseStart":1505,"secureConnectionStart":315.69999980926514},{"duration":525.8999996185303,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":904.5,"connectEnd":904.5,"connectStart":904.5,"domainLookupEnd":904.5,"domainLookupStart":904.5,"fetchStart":904.5,"redirectEnd":0,"redirectStart":0,"requestStart":904.5,"responseEnd":1430.3999996185303,"responseStart":1430.3999996185303,"secureConnectionStart":904.5},{"duration":347.5,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1213,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1213,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1560.5,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":154,"responseStart":306,"responseEnd":309,"domLoading":310,"domInteractive":1563,"domContentLoadedEventStart":1563,"domContentLoadedEventEnd":1608,"domComplete":2738,"loadEventStart":2738,"loadEventEnd":2740,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1509.0999994277954},{"name":"bigPipe.sidebar-id.end","time":1509.8999996185303},{"name":"bigPipe.activity-panel-pipe-id.start","time":1510.0999994277954},{"name":"bigPipe.activity-panel-pipe-id.end","time":1512.3999996185303},{"name":"activityTabFullyLoaded","time":1616}],"measures":[],"correlationId":"dddb2ba00ba7ac","effectiveType":"4g","downlink":9.8,"rtt":0,"serverDuration":91,"dbReadsTimeInMs":13,"dbConnsTimeInMs":22,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}