Type:
Bug
Priority:
Major
Resolution:
Fixed
Affects Version/s:
10.5
This originates from CLX-630.
Let's take S3 Storage engine, and set it up in way that's used when both master and slave are pointed at the same S3 bucket (the specific option we're interested in is the s3_replicate_alter_as_create_select=1 .
Then, if the master runs DROP TABLE tbl when it hasn't yet discovered the existence of table tbl , it will successfully drop the table, but the binlog will get DROP TABLE tbl instead of DROP TABLE IF EXISTS tbl . The table tbl will be gone when the slave executes the statement, which will cause it to stop with an error.
MTR testcase to demonstrate it:
mysql-test/suite/s3/rpl_b.cnf
!include ../rpl/my.cnf
!include ./my.cnf
!include ./slave.cnf
mysql-test/suite/s3/rpl_b.test
--source include/have_s3.inc
--source include/master-slave.inc
connection slave;
show variables like 's3_slave%';
create table t1 (a int, b int) engine=aria;
insert into t1 values (1,1),(2,2),(3,3);
alter table t1 engine=s3;
connection master;
show variables like 's3_replicate%';
drop table t1;
show binlog events;
--sync_slave_with_master
--source include/rpl_end.inc
This will show something like:
master-bin.000001 371 Query 1 479 use `test`; DROP TABLE `t1` /* generated by server */
which is incorrect, it should be DROP TABLE IF EXISTS `t1` .
The slave will not fail because it had "seen" the table t1 before. If we had three nodes (one to create the table, then master->slave to run the testcase), we would get a replication failure.
{"report":{"fcp":865.7000000476837,"ttfb":227.70000004768372,"pageVisibility":"visible","entityId":94588,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"44e7b8d3-59e0-48d2-918e-e5826a103ce5","navigationType":0,"readyForUser":988.5999999046326,"redirectCount":0,"resourceLoadedEnd":669.5999999046326,"resourceLoadedStart":233.09999990463257,"resourceTiming":[{"duration":128.30000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":233.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":233.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":361.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":128.29999995231628,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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":233.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":233.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":361.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":265.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":233.59999990463257,"connectEnd":233.59999990463257,"connectStart":233.59999990463257,"domainLookupEnd":233.59999990463257,"domainLookupStart":233.59999990463257,"fetchStart":233.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":364.2000000476837,"responseEnd":499,"responseStart":377.09999990463257,"secureConnectionStart":233.59999990463257},{"duration":146.20000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":233.79999995231628,"connectEnd":233.79999995231628,"connectStart":233.79999995231628,"domainLookupEnd":233.79999995231628,"domainLookupStart":233.79999995231628,"fetchStart":233.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":365.59999990463257,"responseEnd":380,"responseStart":378.59999990463257,"secureConnectionStart":233.79999995231628},{"duration":374.60000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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":233.79999995231628,"connectEnd":233.79999995231628,"connectStart":233.79999995231628,"domainLookupEnd":233.79999995231628,"domainLookupStart":233.79999995231628,"fetchStart":233.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":364.7000000476837,"responseEnd":608.4000000953674,"responseStart":381.40000009536743,"secureConnectionStart":233.79999995231628},{"duration":153.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":233.90000009536743,"connectEnd":233.90000009536743,"connectStart":233.90000009536743,"domainLookupEnd":233.90000009536743,"domainLookupStart":233.90000009536743,"fetchStart":233.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":366.59999990463257,"responseEnd":387.59999990463257,"responseStart":387.09999990463257,"secureConnectionStart":233.90000009536743},{"duration":132.80000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":234.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":234.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":366.90000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":157.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":234.09999990463257,"connectEnd":234.09999990463257,"connectStart":234.09999990463257,"domainLookupEnd":234.09999990463257,"domainLookupStart":234.09999990463257,"fetchStart":234.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":368.90000009536743,"responseEnd":391.90000009536743,"responseStart":390.7999999523163,"secureConnectionStart":234.09999990463257},{"duration":159.89999985694885,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":234.20000004768372,"connectEnd":234.20000004768372,"connectStart":234.20000004768372,"domainLookupEnd":234.20000004768372,"domainLookupStart":234.20000004768372,"fetchStart":234.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":369.5,"responseEnd":394.09999990463257,"responseStart":393.40000009536743,"secureConnectionStart":234.20000004768372},{"duration":134.40000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/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":234.29999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":234.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":368.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":163.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/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":234.40000009536743,"connectEnd":234.40000009536743,"connectStart":234.40000009536743,"domainLookupEnd":234.40000009536743,"domainLookupStart":234.40000009536743,"fetchStart":234.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":373.59999990463257,"responseEnd":397.59999990463257,"responseStart":397,"secureConnectionStart":234.40000009536743},{"duration":344.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":239.59999990463257,"connectEnd":239.59999990463257,"connectStart":239.59999990463257,"domainLookupEnd":239.59999990463257,"domainLookupStart":239.59999990463257,"fetchStart":239.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":528.7999999523163,"responseEnd":584,"responseStart":581.7999999523163,"secureConnectionStart":239.59999990463257},{"duration":430,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":239.59999990463257,"connectEnd":239.59999990463257,"connectStart":239.59999990463257,"domainLookupEnd":239.59999990463257,"domainLookupStart":239.59999990463257,"fetchStart":239.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":656.4000000953674,"responseEnd":669.5999999046326,"responseStart":669,"secureConnectionStart":239.59999990463257},{"duration":109.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":628.2999999523163,"connectEnd":628.2999999523163,"connectStart":628.2999999523163,"domainLookupEnd":628.2999999523163,"domainLookupStart":628.2999999523163,"fetchStart":628.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":701.7999999523163,"responseEnd":737.7999999523163,"responseStart":736.9000000953674,"secureConnectionStart":628.2999999523163}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":86,"responseStart":227,"responseEnd":232,"domLoading":231,"domInteractive":1040,"domContentLoadedEventStart":1040,"domContentLoadedEventEnd":1082,"domComplete":1684,"loadEventStart":1684,"loadEventEnd":1684,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1022.7999999523163},{"name":"bigPipe.sidebar-id.end","time":1023.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":1023.7000000476837},{"name":"bigPipe.activity-panel-pipe-id.end","time":1024.5999999046326},{"name":"activityTabFullyLoaded","time":1099.7999999523163}],"measures":[],"correlationId":"8cf305bcb1d3d2","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":79,"dbReadsTimeInMs":10,"dbConnsTimeInMs":17,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
http://lists.askmonty.org/pipermail/commits/2020-December/014376.html