mirror of
https://github.com/MariaDB/server.git
synced 2026-04-27 02:35:29 +02:00
MDEV-26: Global transaction ID.
Implement START SLAVE UNTIL master_gtid_pos = "<GTID position>". Add test cases, including a test showing how to use this to promote a new master among a set of slaves.
This commit is contained in:
parent
7202c21b34
commit
9fae993024
19 changed files with 1824 additions and 147 deletions
|
|
@ -263,7 +263,9 @@ public:
|
|||
thread is running).
|
||||
*/
|
||||
|
||||
enum {UNTIL_NONE= 0, UNTIL_MASTER_POS, UNTIL_RELAY_POS} until_condition;
|
||||
enum {
|
||||
UNTIL_NONE= 0, UNTIL_MASTER_POS, UNTIL_RELAY_POS, UNTIL_GTID
|
||||
} until_condition;
|
||||
char until_log_name[FN_REFLEN];
|
||||
ulonglong until_log_pos;
|
||||
/* extension extracted from log_name and converted to int */
|
||||
|
|
@ -277,6 +279,8 @@ public:
|
|||
UNTIL_LOG_NAMES_CMP_UNKNOWN= -2, UNTIL_LOG_NAMES_CMP_LESS= -1,
|
||||
UNTIL_LOG_NAMES_CMP_EQUAL= 0, UNTIL_LOG_NAMES_CMP_GREATER= 1
|
||||
} until_log_names_cmp_result;
|
||||
/* Condition for UNTIL master_gtid_pos. */
|
||||
slave_connection_state until_gtid_pos;
|
||||
|
||||
char cached_charset[6];
|
||||
/*
|
||||
|
|
@ -354,6 +358,8 @@ public:
|
|||
bool is_until_satisfied(THD *thd, Log_event *ev);
|
||||
inline ulonglong until_pos()
|
||||
{
|
||||
DBUG_ASSERT(until_condition == UNTIL_MASTER_POS ||
|
||||
until_condition == UNTIL_RELAY_POS);
|
||||
return ((until_condition == UNTIL_MASTER_POS) ? group_master_log_pos :
|
||||
group_relay_log_pos);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue