Type:
Bug
Priority:
Major
Resolution:
Fixed
Affects Version/s:
None
Component/s:
None
The test case runs a number ($n) of INSERTs on master, then flushes logs, and tries to synchronize the slave with the master.
If it's executed with slave_parallel_threads > 0, we can see in the slave status that the exec master position is the same as on the master right away, although the number of inserted values differs.
After a while, the position is still the same, but the count increases (up to the expected value, eventually).
The test case shows the problem reliably for me with $n = 100 (the first count on the slave is 20 or so), but if it does not for you, please try to increase $n, I suppose it should increase the probability.
--source include/master-slave.inc
--source include/have_innodb.inc
--source include/have_binlog_format_mixed.inc
--enable_connect_log
--connection slave
--source include/stop_slave.inc
--connection master
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY ) ENGINE=MyISAM;
let $n = 100;
--disable_query_log
--echo
--echo # Running $n single inserts on master
--echo
while ($n)
{
INSERT INTO t1 VALUES ();
dec $n;
}
--enable_query_log
FLUSH LOGS;
SHOW MASTER STATUS;
--save_master_pos
--connection slave
--source include/start_slave.inc
--sync_with_master
--echo
--echo # The slave thinks it's synchronized, but the count is off
--echo
query_vertical SHOW SLAVE STATUS;
select count (*) from t1;
--echo
--echo # After waiting a bit, the position is the same, but the count increased
--echo
sleep 2;
query_vertical SHOW SLAVE STATUS;
select count (*) from t1;
connection master;
DROP TABLE t1;
sync_slave_with_master;
--disable_connect_log
--source include/rpl_end.inc
Output:
CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=MyISAM;
# Running 100 single inserts on master
FLUSH LOGS;
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000002 367
connection slave;
include/start_slave.inc
connection slave;
# The slave thinks it's synchronized, but the count is off
SHOW SLAVE STATUS;
Slave_IO_State Waiting for master to send event
Master_Host 127.0.0.1
Master_User root
Master_Port 16000
Connect_Retry 1
Master_Log_File master-bin.000002
Read_Master_Log_Pos 367
Relay_Log_File slave-relay-bin.000005
Relay_Log_Pos 7051
Relay_Master_Log_File master-bin.000002
Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 367
Relay_Log_Space 996
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master 0
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
Replicate_Ignore_Server_Ids
Master_Server_Id 1
Using_Gtid No
select count(*) from t1;
count(*)
29
# After waiting a bit, the position is the same, but the count increased
SHOW SLAVE STATUS;
Slave_IO_State Waiting for master to send event
Master_Host 127.0.0.1
Master_User root
Master_Port 16000
Connect_Retry 1
Master_Log_File master-bin.000002
Read_Master_Log_Pos 367
Relay_Log_File slave-relay-bin.000005
Relay_Log_Pos 22963
Relay_Master_Log_File master-bin.000002
Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 367
Relay_Log_Space 996
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master 2
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
Replicate_Ignore_Server_Ids
Master_Server_Id 1
Using_Gtid No
select count(*) from t1;
count(*)
100
connection master;
DROP TABLE t1;
connection slave;
include/rpl_end.inc
revision-id: knielsen@knielsen-hq.org-20131030065230-kp8dykgyeth6ma55
revno: 3690
branch-nick: 10.0-knielsen
BUILD/compile-pentium-debug-max-no-ndb
relates to
MDEV-4506
MWL#184: Parallel replication of group-committed transactions
Closed
{"report":{"fcp":863.3999998569489,"ttfb":147.89999985694885,"pageVisibility":"visible","entityId":26209,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"68986bd1-e626-4b6c-bb74-cd641ab18d00","navigationType":0,"readyForUser":954.2999999523163,"redirectCount":0,"resourceLoadedEnd":1294.5999999046326,"resourceLoadedStart":153.29999995231628,"resourceTiming":[{"duration":271.7000000476837,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":153.29999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":153.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":425,"responseStart":0,"secureConnectionStart":0},{"duration":271.59999990463257,"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":153.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":153.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":425.09999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":280.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":153.70000004768372,"connectEnd":153.70000004768372,"connectStart":153.70000004768372,"domainLookupEnd":153.70000004768372,"domainLookupStart":153.70000004768372,"fetchStart":153.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":153.70000004768372,"responseEnd":434.2999999523163,"responseStart":434.2999999523163,"secureConnectionStart":153.70000004768372},{"duration":305.7999999523163,"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":153.79999995231628,"connectEnd":153.79999995231628,"connectStart":153.79999995231628,"domainLookupEnd":153.79999995231628,"domainLookupStart":153.79999995231628,"fetchStart":153.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":153.79999995231628,"responseEnd":459.59999990463257,"responseStart":459.59999990463257,"secureConnectionStart":153.79999995231628},{"duration":309.2999999523163,"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":154,"connectEnd":154,"connectStart":154,"domainLookupEnd":154,"domainLookupStart":154,"fetchStart":154,"redirectEnd":0,"redirectStart":0,"requestStart":154,"responseEnd":463.2999999523163,"responseStart":463.2999999523163,"secureConnectionStart":154},{"duration":309.7000000476837,"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":154.09999990463257,"connectEnd":154.09999990463257,"connectStart":154.09999990463257,"domainLookupEnd":154.09999990463257,"domainLookupStart":154.09999990463257,"fetchStart":154.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":154.09999990463257,"responseEnd":463.7999999523163,"responseStart":463.7999999523163,"secureConnectionStart":154.09999990463257},{"duration":310.2000000476837,"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":154.09999990463257,"connectEnd":154.09999990463257,"connectStart":154.09999990463257,"domainLookupEnd":154.09999990463257,"domainLookupStart":154.09999990463257,"fetchStart":154.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":154.09999990463257,"responseEnd":464.2999999523163,"responseStart":464.2999999523163,"secureConnectionStart":154.09999990463257},{"duration":310.5,"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":154.20000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":154.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":464.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":310.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":154.29999995231628,"connectEnd":154.29999995231628,"connectStart":154.29999995231628,"domainLookupEnd":154.29999995231628,"domainLookupStart":154.29999995231628,"fetchStart":154.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":154.29999995231628,"responseEnd":464.7999999523163,"responseStart":464.7999999523163,"secureConnectionStart":154.29999995231628},{"duration":310.90000009536743,"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":154.39999985694885,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":154.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":465.2999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":311.09999990463257,"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":154.5,"connectEnd":154.5,"connectStart":154.5,"domainLookupEnd":154.5,"domainLookupStart":154.5,"fetchStart":154.5,"redirectEnd":0,"redirectStart":0,"requestStart":154.5,"responseEnd":465.59999990463257,"responseStart":465.59999990463257,"secureConnectionStart":154.5},{"duration":585.7000000476837,"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":160.5,"connectEnd":160.5,"connectStart":160.5,"domainLookupEnd":160.5,"domainLookupStart":160.5,"fetchStart":160.5,"redirectEnd":0,"redirectStart":0,"requestStart":160.5,"responseEnd":746.2000000476837,"responseStart":746.2000000476837,"secureConnectionStart":160.5},{"duration":1134.0999999046326,"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":160.5,"connectEnd":160.5,"connectStart":160.5,"domainLookupEnd":160.5,"domainLookupStart":160.5,"fetchStart":160.5,"redirectEnd":0,"redirectStart":0,"requestStart":160.5,"responseEnd":1294.5999999046326,"responseStart":1294.5999999046326,"secureConnectionStart":160.5},{"duration":514.6000001430511,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":665.8999998569489,"connectEnd":665.8999998569489,"connectStart":665.8999998569489,"domainLookupEnd":665.8999998569489,"domainLookupStart":665.8999998569489,"fetchStart":665.8999998569489,"redirectEnd":0,"redirectStart":0,"requestStart":665.8999998569489,"responseEnd":1180.5,"responseStart":1180.5,"secureConnectionStart":665.8999998569489},{"duration":459.19999980926514,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":841.7000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":841.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1300.8999998569489,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":3,"responseStart":148,"responseEnd":158,"domLoading":151,"domInteractive":1316,"domContentLoadedEventStart":1316,"domContentLoadedEventEnd":1357,"domComplete":2164,"loadEventStart":2164,"loadEventEnd":2165,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1296.3999998569489},{"name":"bigPipe.sidebar-id.end","time":1297.2000000476837},{"name":"bigPipe.activity-panel-pipe-id.start","time":1297.3999998569489},{"name":"bigPipe.activity-panel-pipe-id.end","time":1299.7999999523163},{"name":"activityTabFullyLoaded","time":1364.5999999046326}],"measures":[],"correlationId":"1241a5fce676a1","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":71,"dbReadsTimeInMs":11,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}