Gaps in Retrieved_Gtid_Set while no gaps in Executed_Gtid_Set
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MySQL Server |
Unknown
|
Unknown
|
|||
Percona Server moved to https://jira.percona.com/projects/PS |
Fix Released
|
Medium
|
Unassigned | ||
5.6 |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Under certain circumstances it is possible that Retrieved_Gtid_Set on slave will contain gaps while actually no gaps will be in Executed_Gtid_Set and slave binary logs.
This happens when slave rotates relay log in such a way that last event contains record which sets GTID_NEXT, then following log contains few GTIDs, then slave restarts. After restart GTIDs for Retrieved_Gtid_Set executed wrongly and there are fantom gaps.
How to repeat.
Modify sources as follow (this is against MySQL from GitHub):
diff --git a/sql/binlog.cc b/sql/binlog.cc
index a02b987..9adb8bd 100644
--- a/sql/binlog.cc
+++ b/sql/binlog.cc
@@ -5057,6 +5057,7 @@ bool MYSQL_BIN_
{
error= new_file_
+ DBUG_EXECUTE_
}
}
@@ -5092,7 +5093,7 @@ bool MYSQL_BIN_
}
-bool MYSQL_BIN_
+bool MYSQL_BIN_
{
DBUG_
@@ -5101,6 +5102,8 @@ bool MYSQL_BIN_
DBUG_
mysql_
+ DBUG_EXECUTE_
+
// write data
bool error= false;
if (my_b_append(
diff --git a/sql/binlog.h b/sql/binlog.h
index 38efe64..4ecda34 100644
--- a/sql/binlog.h
+++ b/sql/binlog.h
@@ -607,7 +607,7 @@ public:
bool is_query_
#ifdef HAVE_REPLICATION
- bool append_buffer(const char* buf, uint len, Master_info *mi);
+ bool append_buffer(const char* buf, uint len, Master_info *mi, Log_event_type event_type);
bool append_
private:
bool after_append_
diff --git a/sql/rpl_slave.cc b/sql/rpl_slave.cc
index 30e85fc..b60e916 100644
--- a/sql/rpl_slave.cc
+++ b/sql/rpl_slave.cc
@@ -7051,7 +7051,7 @@ static int queue_event(
else
{
/* write the event to the relay log */
- if (likely(
+ if (likely(
{
Run attached test case.
You will see in the end:
Retrieved_Gtid_Set 6030e94d-
Executed_Gtid_Set 6030e94d-
tags: | added: upstream |
http:// bugs.mysql. com/bug. php?id= 76959