[Maria-developers] Documentation about GTID
Hi! I am testing MariaDB 10.0.2, and I am interested in GTID. The only documentation I found is the worklog. Without docs at hand, I tried something: slave1 [localhost] {msandbox} ((none)) > CHANGE MASTER TO master_gtid_pos=''; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'master_gtid_pos=''' at line 1 slave1 [localhost] {msandbox} ((none)) > CHANGE MASTER TO master_gtid_pos=auto; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'master_gtid_pos=auto' at line 1 This is supposed to work, according to a blog post and some worklogs, but it doesn't. As for GTID in practice, it seems to be active. slave1 [localhost] {msandbox} ((none)) > show variables like '%gtid%'; +----------------+--------+ | Variable_name | Value | +----------------+--------+ | gtid_domain_id | 0 | | gtid_pos | 0-1-11 | | gtid_seq_no | 0 | +----------------+--------+ 3 rows in set (0.00 sec) slave1 [localhost] {msandbox} ((none)) > use mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed slave1 [localhost] {msandbox} (mysql) > select * from rpl_slave_state; +-----------+--------+-----------+--------+ | domain_id | sub_id | server_id | seq_no | +-----------+--------+-----------+--------+ | 0 | 12 | 1 | 11 | +-----------+--------+-----------+--------+ However, when I run "show slave status", I get: Using_Gtid: 0 Could you provide a pointer to the docs of the expected behavior at this stage? Thanks Giuseppe
This was changed on the way (http://bazaar.launchpad.net/~maria-captains/maria/10.0-mdev26/revision/3554). Instead of "CHANGE MASTER TO master_gtid_pos=auto" you need to use "CHANGE MASTER TO master_use_gtid=1". If you want to actually set gtid_pos you need to set @@global.gtid_pos. Pavel On Wed, May 1, 2013 at 8:50 AM, Giuseppe Maxia <g.maxia@gmail.com> wrote:
Hi! I am testing MariaDB 10.0.2, and I am interested in GTID. The only documentation I found is the worklog.
Without docs at hand, I tried something:
slave1 [localhost] {msandbox} ((none)) > CHANGE MASTER TO master_gtid_pos=''; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'master_gtid_pos=''' at line 1 slave1 [localhost] {msandbox} ((none)) > CHANGE MASTER TO master_gtid_pos=auto; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'master_gtid_pos=auto' at line 1
This is supposed to work, according to a blog post and some worklogs, but it doesn't.
As for GTID in practice, it seems to be active.
slave1 [localhost] {msandbox} ((none)) > show variables like '%gtid%'; +----------------+--------+ | Variable_name | Value | +----------------+--------+ | gtid_domain_id | 0 | | gtid_pos | 0-1-11 | | gtid_seq_no | 0 | +----------------+--------+ 3 rows in set (0.00 sec)
slave1 [localhost] {msandbox} ((none)) > use mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A
Database changed
slave1 [localhost] {msandbox} (mysql) > select * from rpl_slave_state; +-----------+--------+-----------+--------+ | domain_id | sub_id | server_id | seq_no | +-----------+--------+-----------+--------+ | 0 | 12 | 1 | 11 | +-----------+--------+-----------+--------+
However, when I run "show slave status", I get:
Using_Gtid: 0
Could you provide a pointer to the docs of the expected behavior at this stage?
Thanks
Giuseppe
_______________________________________________ Mailing list: https://launchpad.net/~maria-developers Post to : maria-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-developers More help : https://help.launchpad.net/ListHelp
Hi, Thanks for the quick answer. However, neither of the suggested syntax works with the build currently released. Moreover, since the commit comment mentions multiple masters, it would be nice to have some documentation that explains what to expect when using GTID and multiple masters. Cheers Giuseppe On Wednesday, May 1, 2013 at 17:55 , Pavel Ivanov wrote:
This was changed on the way (http://bazaar.launchpad.net/~maria-captains/maria/10.0-mdev26/revision/3554). Instead of "CHANGE MASTER TO master_gtid_pos=auto" you need to use "CHANGE MASTER TO master_use_gtid=1". If you want to actually set gtid_pos you need to set @@global.gtid_pos.
Pavel
On Wed, May 1, 2013 at 8:50 AM, Giuseppe Maxia <g.maxia@gmail.com (mailto:g.maxia@gmail.com)> wrote:
Hi! I am testing MariaDB 10.0.2, and I am interested in GTID. The only documentation I found is the worklog.
Without docs at hand, I tried something:
slave1 [localhost] {msandbox} ((none)) > CHANGE MASTER TO master_gtid_pos=''; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'master_gtid_pos=''' at line 1 slave1 [localhost] {msandbox} ((none)) > CHANGE MASTER TO master_gtid_pos=auto; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'master_gtid_pos=auto' at line 1
This is supposed to work, according to a blog post and some worklogs, but it doesn't.
As for GTID in practice, it seems to be active.
slave1 [localhost] {msandbox} ((none)) > show variables like '%gtid%'; +----------------+--------+ | Variable_name | Value | +----------------+--------+ | gtid_domain_id | 0 | | gtid_pos | 0-1-11 | | gtid_seq_no | 0 | +----------------+--------+ 3 rows in set (0.00 sec)
slave1 [localhost] {msandbox} ((none)) > use mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A
Database changed
slave1 [localhost] {msandbox} (mysql) > select * from rpl_slave_state; +-----------+--------+-----------+--------+ | domain_id | sub_id | server_id | seq_no | +-----------+--------+-----------+--------+ | 0 | 12 | 1 | 11 | +-----------+--------+-----------+--------+
However, when I run "show slave status", I get:
Using_Gtid: 0
Could you provide a pointer to the docs of the expected behavior at this stage?
Thanks
Giuseppe
_______________________________________________ Mailing list: https://launchpad.net/~maria-developers Post to : maria-developers@lists.launchpad.net (mailto:maria-developers@lists.launchpad.net) Unsubscribe : https://launchpad.net/~maria-developers More help : https://help.launchpad.net/ListHelp
Giuseppe Maxia <g.maxia@gmail.com> writes:
The only documentation I found is the worklog.
Yes, docs will come of course, but they are not written yet. As Pavel mentioned, there are some changes compared to original design, that were done as a result of QA to fix some potential issues with the user experience.
Without docs at hand, I tried something:
slave1 [localhost] {msandbox} ((none)) > CHANGE MASTER TO master_gtid_pos=''; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'master_gtid_pos=''' at line 1 slave1 [localhost] {msandbox} ((none)) > CHANGE MASTER TO master_gtid_pos=auto; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'master_gtid_pos=auto' at line 1
As Pavel mentioned, the syntax is now: SET GLOBAL gtid_pos=""; CHANGE MASTER TO MASTER_USE_GTID=1;
However, neither of the suggested syntax works with the build currently released.
Strange ... can you share exact query and error message?
Moreover, since the commit comment mentions multiple masters, it would be nice to have some documentation that explains what to expect when using GTID and multiple masters.
If you do not want to wait for documentation, my best suggestion is to look at the mysql-test-run test cases: rpl.rpl_gtid* and multi_source.gtid*. They are kept up-to-date with every commit so are guaranteed to show what works. In mysql-test/suite/multi_source/gtid.test there is an example which starts with the topology M1->S1,M2->S1,S1->S2. It then moves S2 one level up: M1->S1,M2->S1,M1->S2,M2->S2 Finally it moves S1 down to have M1->S2,M2->S2,S2->S1 So it shows the ability to have multi-level multimaster setups, and move a slave server between itself having multiple direct masters, and being a single-master slave of a master server that is itself a slave of multiple masters. I spent a lot of effort in the design phase figuring out how to make this work, and it was a main motivation for the concept of domain_id. - Kristian.
Kristian, Thanks for your answer. The reason for the error I mentioned before is that I used a different syntax which I found in one of the WL. instead of CHANGE MASTER TO MASTER_USE_GTID=1; I was using: CHANGE MASTER TO master_gtid_pos=1; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'master_gtid_pos=1' at line 1 I will have a look at the test suite at the next favorable occasion. Cheers Giuseppe On Wednesday, May 1, 2013 at 22:51 , Kristian Nielsen wrote:
Giuseppe Maxia <g.maxia@gmail.com (mailto:g.maxia@gmail.com)> writes:
The only documentation I found is the worklog.
Yes, docs will come of course, but they are not written yet. As Pavel mentioned, there are some changes compared to original design, that were done as a result of QA to fix some potential issues with the user experience.
Without docs at hand, I tried something:
slave1 [localhost] {msandbox} ((none)) > CHANGE MASTER TO master_gtid_pos=''; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'master_gtid_pos=''' at line 1 slave1 [localhost] {msandbox} ((none)) > CHANGE MASTER TO master_gtid_pos=auto; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'master_gtid_pos=auto' at line 1
As Pavel mentioned, the syntax is now:
SET GLOBAL gtid_pos=""; CHANGE MASTER TO MASTER_USE_GTID=1;
However, neither of the suggested syntax works with the build currently released.
Strange ... can you share exact query and error message?
Moreover, since the commit comment mentions multiple masters, it would be nice to have some documentation that explains what to expect when using GTID and multiple masters.
If you do not want to wait for documentation, my best suggestion is to look at the mysql-test-run test cases: rpl.rpl_gtid* and multi_source.gtid*. They are kept up-to-date with every commit so are guaranteed to show what works.
In mysql-test/suite/multi_source/gtid.test there is an example which starts with the topology M1->S1,M2->S1,S1->S2.
It then moves S2 one level up: M1->S1,M2->S1,M1->S2,M2->S2
Finally it moves S1 down to have M1->S2,M2->S2,S2->S1
So it shows the ability to have multi-level multimaster setups, and move a slave server between itself having multiple direct masters, and being a single-master slave of a master server that is itself a slave of multiple masters. I spent a lot of effort in the design phase figuring out how to make this work, and it was a main motivation for the concept of domain_id.
- Kristian.
Giuseppe Maxia <g.maxia@gmail.com> writes:
I was using:
CHANGE MASTER TO master_gtid_pos=1; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'master_gtid_pos=1' at line 1
Ok, thanks.
I will have a look at the test suite at the next favorable occasion.
Ok, good luck. I will try to get some initial docs written up by the end of the week. - Kristian.
Friendly warning: I've discovered a critical bug in GTID implementation https://mariadb.atlassian.net/browse/MDEV-4473. So use the feature carefully. Pavel On Wed, May 1, 2013 at 10:30 PM, Kristian Nielsen <knielsen@knielsen-hq.org> wrote:
Giuseppe Maxia <g.maxia@gmail.com> writes:
I was using:
CHANGE MASTER TO master_gtid_pos=1; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'master_gtid_pos=1' at line 1
Ok, thanks.
I will have a look at the test suite at the next favorable occasion.
Ok, good luck.
I will try to get some initial docs written up by the end of the week.
- Kristian.
_______________________________________________ Mailing list: https://launchpad.net/~maria-developers Post to : maria-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-developers More help : https://help.launchpad.net/ListHelp
Welcome back Google. Great to see you active in the MySQL community again. On Thu, May 2, 2013 at 3:24 PM, Pavel Ivanov <pivanof@google.com> wrote:
Friendly warning: I've discovered a critical bug in GTID implementation https://mariadb.atlassian.net/browse/MDEV-4473. So use the feature carefully.
Pavel
On Wed, May 1, 2013 at 10:30 PM, Kristian Nielsen <knielsen@knielsen-hq.org> wrote:
Giuseppe Maxia <g.maxia@gmail.com> writes:
I was using:
CHANGE MASTER TO master_gtid_pos=1; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'master_gtid_pos=1' at line 1
Ok, thanks.
I will have a look at the test suite at the next favorable occasion.
Ok, good luck.
I will try to get some initial docs written up by the end of the week.
- Kristian.
_______________________________________________ Mailing list: https://launchpad.net/~maria-developers Post to : maria-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-developers More help : https://help.launchpad.net/ListHelp
_______________________________________________ Mailing list: https://launchpad.net/~maria-developers Post to : maria-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-developers More help : https://help.launchpad.net/ListHelp
-- Mark Callaghan mdcallag@gmail.com
Pavel Ivanov <pivanof@google.com> writes:
Friendly warning: I've discovered a critical bug in GTID implementation https://mariadb.atlassian.net/browse/MDEV-4473. So use
Thanks for digging this up, and even supplying a nice test case! I've pushed a fix to 10.0-base, and merged it to 10.0. The logic here is a bit complex, so let me try to explain what is going on. Normally, when the slave requests to start replication from some GTID G, the master needs to find the binlog file that contains G, scan through it until it reaches the event G, and then start sending events to the slave at the point after the event group of G. However, suppose that we are using two replication domains 1 and 2, but there are no events logged in domain 2 for a month. The slave will send its start gtid position, say 1-1-10000,2-2-500. Since there was nothing logged in domain 2 for one month, it is likely that the binlog file containing 2-2-500 was purged. So if we tried to locate that purged binlog, the slave would fail to connect. But as long as 2-2-500 was the _last_ event logged in domain 2 (which is likely if it was logged one month ago), then we do not need to find the old purged binlog file - we can start from the beginning of any later binlog file. The code to handle this special case in gtid_find_binlog_file() and contains_all_slave_gtid() was the code with the bug. The way the code works is to look at the Gtid_list_log_event at the start of every. This contains the list of the GTIDs with the highest sequence number logged in previous binlog files, for each (domain_id, server_id). Further, the list is sorted on domain_id, and the last GTID in each group is the last GTID logged. This allows to handle the above-mentioned special case. If 2-2-500 appears in the Gtid_list_log_event as the last event logged in prior binlogs, then we can start sending events from the beginning of this binlog, we do not need to go back further. However, the code had a bug, it was missing the check that the GTID was the last one in the group for that domain. So if the Gtid_list_log_event contained 1-1-10000,2-2-500,2-3-600, then the code would select this as the starting point for 2-2-500. This is wrong, because we need to go back to find 2-3-600 and send this to the slave. The fix is to add the check that the GTID is the last one in its domain_id group. In the bug report, you wondered why there are multiple GTIDs for one domain_id in Gtid_list_log_event (there is one for each server id). This is needed to be able to locate any given GTID in the binlogs, without relying on sequence numbers being strictly increasing. There are a number of scenarios where this can happen. Even if most of these are undesirable configurations / user error, it is sure to occur in practice, and I spent a lot of effort in the design to make sure that GTID will still behave reasonably in such cases, and not silently corrupt replication. There is a careful distinction between the slave state (gtid position), which has only one GTID per domain id, and master binlog state (Gtid_list_log_event), which has one per (domain_id, server_id) combination. The latter can accumulate lots of cruft in the form of old, no longer used server_id's, but it does not matter, as it is not something users ever need to look at. The former _is_ something the user might want to look at, and it has the simple format of just one GTID per domain configured by the user. (This was BTW a major motivation for redesigning GTID from scratch rather than taking the MySQL 5.6 version. In MySQL 5.6, they do not make this distiction, so the user-visible slave GTID position will accumulate cruft in the form of no longer used server UUIDs, which will hang around basically forever). Thanks, - Kristian.
On Fri, May 3, 2013 at 3:26 AM, Kristian Nielsen <knielsen@knielsen-hq.org> wrote:
In the bug report, you wondered why there are multiple GTIDs for one domain_id in Gtid_list_log_event (there is one for each server id).
This is needed to be able to locate any given GTID in the binlogs, without relying on sequence numbers being strictly increasing. There are a number of scenarios where this can happen. Even if most of these are undesirable configurations / user error, it is sure to occur in practice, and I spent a lot of effort in the design to make sure that GTID will still behave reasonably in such cases, and not silently corrupt replication.
There is a careful distinction between the slave state (gtid position), which has only one GTID per domain id, and master binlog state (Gtid_list_log_event), which has one per (domain_id, server_id) combination. The latter can accumulate lots of cruft in the form of old, no longer used server_id's, but it does not matter, as it is not something users ever need to look at. The former _is_ something the user might want to look at, and it has the simple format of just one GTID per domain configured by the user.
Well, I'd argue that accumulating lots of cruft does matter. Let's say it accumulated 10,000 different GTIDs. It will significantly slow down the slave connection initialization and it will blow up binlog size. The first effect could be especially dangerous because if e.g. 3 slaves are connected to master simultaneously master could fully consume 3 CPUs for a prolonged period of time which may affect ability to respond to client queries. Overall I guess I don't quite like this design decision. It basically means that in the proper configuration special care should be taken to make sure that server_id numbers don't get retired forever but get reused instead...
(This was BTW a major motivation for redesigning GTID from scratch rather than taking the MySQL 5.6 version. In MySQL 5.6, they do not make this distiction, so the user-visible slave GTID position will accumulate cruft in the form of no longer used server UUIDs, which will hang around basically forever).
Yes, this is a very wise decision by MariaDB. Pavel
Pavel Ivanov <pivanof@google.com> writes:
Well, I'd argue that accumulating lots of cruft does matter. Let's say it accumulated 10,000 different GTIDs. It will significantly slow down the slave connection initialization and it will blow up binlog size. The first effect could be especially dangerous because if e.g. 3 slaves are connected to master simultaneously master could fully consume 3 CPUs for a prolonged period of time which may affect ability to respond to client queries.
Overall I guess I don't quite like this design decision. It basically means that in the proper configuration special care should be taken to make sure that server_id numbers don't get retired forever but get reused instead...
I do not think it will be a problem. Even with 10000 master failovers (that's 10 times per day, every day for 3 years!), it's just 150kB in each binlog file, plus a single iteration over it during slave connect. But if it turns out that I am wrong and it is in fact a problem, we can easily add later something that prunes this information. A given (domain_id, server_id, seq_no) GTID is only needed as long as there is any slave that might request to start replicating from this position. After that, it can be safely omitted in subsequent Gtid_list_log_events. For example, each time we rotate the binlog, we can check for any GTID in Gtid_list_log_event that was the same in the Gtid_list_log_event of the first unpurged binlog file, and omit any such in the next Gtid_list_log_event output. But there is no reason to spend time on that until we know it is a problem. Maybe the deeper issue is that you would prefer a design where sequence number is assumed unique by itself (or (domain_id, sequence_number) if using multi-source). And the code is allowed to silently break if this assumption is violated by user? This makes a lot of things simpler, of course. I did think a lot about this, and in the end I decided against it, because of numerous cases where this could make things harder for users that are perhaps not intimately aware with how GTID works. I am still hopeful that the current design can give the best of both worlds: something that "just works" in most cases for most users, and still provides what is needed for advanced users that can be expected to know what they are doing. - Kristian.
On Fri, May 3, 2013 at 7:45 AM, Kristian Nielsen <knielsen@knielsen-hq.org> wrote:
Maybe the deeper issue is that you would prefer a design where sequence number is assumed unique by itself (or (domain_id, sequence_number) if using multi-source). And the code is allowed to silently break if this assumption is violated by user?
This makes a lot of things simpler, of course. I did think a lot about this, and in the end I decided against it, because of numerous cases where this could make things harder for users that are perhaps not intimately aware with how GTID works. I am still hopeful that the current design can give the best of both worlds: something that "just works" in most cases for most users, and still provides what is needed for advanced users that can be expected to know what they are doing.
Now that you mentioned this I'm worried. Tell me please what will happen with MariaDB in the following situation. Let's say we have slave fully synced with master, the last GTID in binlogs (and I guess the value of @@global.gtid_pos) is 0-1-100. Now let's say there's a bug that didn't configure slave read-only, or for whatever other unwanted reason slave got disconnected from master and someone connected to slave and executed a binlogged transaction there. I guess it will be assigned GTID 0-2-101 (or it will be 1-2-1?). If someone checks value of @@global.gtid_pos at this point he will be able to notice the discrepancy between master and slave. But it seems what you are saying is if after that slave connects back to master he will be able to successfully replicate and will execute transactions 0-1-101, 0-1-102 etc. Slave will still carry information in the binlog about existence of transaction 0-2-101 but no one will be able to detect that from outside of mysql. And if later this slave becomes a master then it will push this extra transaction to all other servers. But if the binlog file with this transaction will be already purged by the time the slave becomes master then replication will be broken and no one will be able to connect to it as slave. Do I understand the situation correctly? Is this "works as intended"? Thank you, Pavel
Pavel Ivanov <pivanof@google.com> writes:
Now that you mentioned this I'm worried. Tell me please what will happen with MariaDB in the following situation. Let's say we have
Ok, here is what the current code will do.
slave fully synced with master, the last GTID in binlogs (and I guess the value of @@global.gtid_pos) is 0-1-100. Now let's say there's a bug that didn't configure slave read-only, or for whatever other unwanted reason slave got disconnected from master and someone connected to slave and executed a binlogged transaction there. I guess it will be assigned GTID 0-2-101 (or it will be 1-2-1?). If someone
Yes, 0-2-101.
checks value of @@global.gtid_pos at this point he will be able to notice the discrepancy between master and slave. But it seems what you are saying is if after that slave connects back to master he will be able to successfully replicate and will execute transactions 0-1-101,
Actually, in this particular situation, you will get an error when the slave tries to reconnect. Because the last GTID executed on the slave is 0-2-101, and this is what the slave is asking the master to start from. But the master's binlog does not contain this GTID, so the master returns error to the slave. On the other hand, if the slave was not stopped when the extra transaction was executed on the slave, replication will continue, and the slave will get in its binlog: ... 0-1-100, 0-2-101, 0-1-101, 0-1-102, ...
0-1-102 etc. Slave will still carry information in the binlog about existence of transaction 0-2-101
Yes, in the sense that slave has the ability to locate this transaction in its binlog.
but no one will be able to detect that from outside of mysql.
Well, SHOW BINLOG EVENTS will display it.
And if later this slave becomes a master then it will push this extra transaction to all other servers.
Yes.
But if the binlog file with this transaction will be already purged by the time the slave becomes master then replication will be broken and no one will be able to connect to it as slave.
No. Why would there be problems to connect? I am not sure I understand your concern here. At a guess, it sounds like your worry is that the presence of 0-2-101 in the binlog Gtid_list event will require all connecting slaves to know of this event, or they will fail to connect? That is not how it works. It is the other way around, presence of a GTID in the state of the connection slave requires that the master binlog knows of this event. The GTIDs in the Gtid_list event are only used when searching for the right binlog to start from when a slave connects with the same domain_id and server_id. Otherwise they are ignored. This is another deliberate difference from MySQL 5.6 global transaction ID. In 5.6, if I have understood correctly, if an incorrect transaction sneaks into the slave as you describe, you will be stuck with it forever, and people do tricks like inject fake empty transactions on servers that lack them to make it possible to even connect as a slave again. In contrast, MariaDB GTID is self-healing, just like ordinary replication. If you inject a wrong transaction on a slave, then your slave and master may be out of sync, but as the binlog position progresses beyond the problem point (maybe with the help of slave_skip_counter or whatever), things work again, the sins of the past forgotten. Because the slave state is just a single GTID (per domain id). If I misunderstood your concern, please elaborate and I will try to give a better answer. - Kristian.
On Fri, May 3, 2013 at 12:01 PM, Kristian Nielsen <knielsen@knielsen-hq.org> wrote:
slave fully synced with master, the last GTID in binlogs (and I guess the value of @@global.gtid_pos) is 0-1-100. Now let's say there's a bug that didn't configure slave read-only, or for whatever other unwanted reason slave got disconnected from master and someone connected to slave and executed a binlogged transaction there. I guess it will be assigned GTID 0-2-101 (or it will be 1-2-1?). If someone
Yes, 0-2-101.
Not related to the rest of email: are multiple replication domains generated only by setting gtid_domain_id variable? Are there situations when server can decide to put transaction into different domain by itself?
checks value of @@global.gtid_pos at this point he will be able to notice the discrepancy between master and slave. But it seems what you are saying is if after that slave connects back to master he will be able to successfully replicate and will execute transactions 0-1-101,
Actually, in this particular situation, you will get an error when the slave tries to reconnect. Because the last GTID executed on the slave is 0-2-101, and this is what the slave is asking the master to start from. But the master's binlog does not contain this GTID, so the master returns error to the slave.
On the other hand, if the slave was not stopped when the extra transaction was executed on the slave, replication will continue, and the slave will get in its binlog: ... 0-1-100, 0-2-101, 0-1-101, 0-1-102, ...
0-1-102 etc. Slave will still carry information in the binlog about existence of transaction 0-2-101
Yes, in the sense that slave has the ability to locate this transaction in its binlog.
but no one will be able to detect that from outside of mysql.
Well, SHOW BINLOG EVENTS will display it.
SHOW BINLOG EVENTS on all servers and then comparing them to make sure that they represent the same set of transactions... You don't seriously think that it's a good way of monitoring, do you?
And if later this slave becomes a master then it will push this extra transaction to all other servers.
Yes.
Probably this answer is incorrect, read below.
But if the binlog file with this transaction will be already purged by the time the slave becomes master then replication will be broken and no one will be able to connect to it as slave.
No. Why would there be problems to connect?
I am not sure I understand your concern here. At a guess, it sounds like your worry is that the presence of 0-2-101 in the binlog Gtid_list event will require all connecting slaves to know of this event, or they will fail to connect? That is not how it works. It is the other way around, presence of a GTID in the state of the connection slave requires that the master binlog knows of this event.
The GTIDs in the Gtid_list event are only used when searching for the right binlog to start from when a slave connects with the same domain_id and server_id. Otherwise they are ignored.
This is exactly my concern currently (wasn't initially). So let's say as you said above extra transaction was executed when slave was connected, or (more probable case if possible) when IO thread was already disconnected but SQL thread didn't catch up yet. In both cases extra transaction somehow got there in the middle of the stream, and so the last GTID is the valid one, existing on the master. So slave is able to connect to master again and everything works fine. A couple of days passed without change of the master, slave already deleted the binlog file with transaction 0-2-101. Somewhere on the transaction 0-1-10000 the server 2 becomes master... Hm... Looking at the code it seems that at this point all slaves should be able to continue to replicate from server 2 just fine, although result of transaction 0-2-101 will still exist only on server 2 and nowhere else. Which means that your answer above is incorrect (as long as slaves connecting to server 2 are at state 0-1-101 or higher). If this is true then I'm relieved and have no more concerns... Pavel
Pavel Ivanov <pivanof@google.com> writes:
This is exactly my concern currently (wasn't initially). So let's say as you said above extra transaction was executed when slave was connected, or (more probable case if possible) when IO thread was already disconnected but SQL thread didn't catch up yet. In both cases extra transaction somehow got there in the middle of the stream, and so the last GTID is the valid one, existing on the master. So slave is able to connect to master again and everything works fine. A couple of days passed without change of the master, slave already deleted the binlog file with transaction 0-2-101. Somewhere on the transaction 0-1-10000 the server 2 becomes master...
Hm... Looking at the code it seems that at this point all slaves should be able to continue to replicate from server 2 just fine, although result of transaction 0-2-101 will still exist only on server 2 and nowhere else. Which means that your answer above is incorrect (as long as slaves connecting to server 2 are at state 0-1-101 or higher). If this is true then I'm relieved and have no more concerns...
Aha, now I see. Yes, you are right. 0-2-101 will exist only on server 2. It will not be replicated to other slaves if server 2 later becomes master.
And if later this slave becomes a master then it will push this extra transaction to all other servers.
Yes.
Probably this answer is incorrect, read below.
Correct. I was thinking of the case where the slave was already itself a master when the extra transaction was executed.
Not related to the rest of email: are multiple replication domains generated only by setting gtid_domain_id variable? Are there situations when server can decide to put transaction into different domain by itself?
Correct, replication domains can only be generated by user explicitly setting gtid_domain_id. Servers will never invent domain ids on its own. - Kristian.
On Fri, May 3, 2013 at 1:46 PM, Kristian Nielsen <knielsen@knielsen-hq.org> wrote:
This is exactly my concern currently (wasn't initially). So let's say as you said above extra transaction was executed when slave was connected, or (more probable case if possible) when IO thread was already disconnected but SQL thread didn't catch up yet. In both cases extra transaction somehow got there in the middle of the stream, and so the last GTID is the valid one, existing on the master. So slave is able to connect to master again and everything works fine. A couple of days passed without change of the master, slave already deleted the binlog file with transaction 0-2-101. Somewhere on the transaction 0-1-10000 the server 2 becomes master...
Hm... Looking at the code it seems that at this point all slaves should be able to continue to replicate from server 2 just fine, although result of transaction 0-2-101 will still exist only on server 2 and nowhere else. Which means that your answer above is incorrect (as long as slaves connecting to server 2 are at state 0-1-101 or higher). If this is true then I'm relieved and have no more concerns...
Aha, now I see. Yes, you are right. 0-2-101 will exist only on server 2. It will not be replicated to other slaves if server 2 later becomes master.
Thinking about such situation more it still seems to me that it would be beneficial to have an additional flag that will require for seq_no in GTIDs of committed transactions to be strictly increasing for each domain. It will add fault-tolerance to production setups. Do you think it's feasible to add such flag (it may be false by default)? Pavel
Pavel Ivanov <pivanof@google.com> writes:
Thinking about such situation more it still seems to me that it would be beneficial to have an additional flag that will require for seq_no in GTIDs of committed transactions to be strictly increasing for each domain. It will add fault-tolerance to production setups. Do you think it's feasible to add such flag (it may be false by default)?
Yes, I agree. I have been thinking about adding such a "gtid strict mode" myself. I think it is a good idea, and I will look into it later when I have handled more urgent stuff. - Kristian.
On Fri, May 3, 2013 at 2:05 PM, Kristian Nielsen <knielsen@knielsen-hq.org> wrote:
Pavel Ivanov <pivanof@google.com> writes:
Thinking about such situation more it still seems to me that it would be beneficial to have an additional flag that will require for seq_no in GTIDs of committed transactions to be strictly increasing for each domain. It will add fault-tolerance to production setups. Do you think it's feasible to add such flag (it may be false by default)?
Yes, I agree. I have been thinking about adding such a "gtid strict mode" myself. I think it is a good idea, and I will look into it later when I have handled more urgent stuff.
For tracking purposes: https://mariadb.atlassian.net/browse/MDEV-4478. Pavel
Kristian Nielsen <knielsen@knielsen-hq.org> writes:
I will try to get some initial docs written up by the end of the week.
Giuseppe, here (attached) is my first stab at documentation for MariaDB GTID. Thanks for prodding me to get this done, even if it was a very gentle prodding :-) Daniel, do you think you can get these formatted properly and included in some appropriate place in the Knowledgebase? And feel free to fix any problems you find in the text on the way, of course. I will then make sure to keep this updated as the code progresses. This is just a first stab, I am sure there is much that is incomplete and I will work to extend it as needed (comments welcome if anything is found missing). - Kristian. A. MariaDB global transaction ID
From version 10.0, MariaDB supports global transaction IDs for replication.
MariaDB replication in general works as follows: On a master server, all updates to the database (DML and DDL) are written into the binary log as binlog events. A slave server connects to the master and reads the binlog events, then applies the events locally to replicate the same changes as done on the master. A server can be both a master and a slave at the same time, and it is thus possible for binlog events to replicated through multiple levels of servers. A slave server keeps track of the position in the master's binlog of the last event applied on the slave. This allows the slave server to re-connect and resume from where it left off after replication has been temporarily stopped. It also allows to disconnect from the master server and connect to a different server to resume replication from a new master, as long as the new master has the proper binlog events, and the new master connection starts replicationg at the appropriate point in the binlogs. Global transaction ID introduces a new event attached to each event group in the binlog. (An event group is a collection of events that are always applied as a unit. They are best thought of as a "transaction", though they also include non-transactional DML statements, as well as DDL). As an event group is replicated from master server to slave server, the global transaction ID is preserved. Since the ID is globally unique across the entire group of servers, this makes it easy to uniquely identify the same binlog events on different servers that replicate each other (this was not easily possible before MariaDB 10.0). Using global transaction ID provides two main benefits: 1. Easy to change a slave server to connect to and replicate from a different master server. The slave remembers the global transaction ID of the last event group applied from the old master. This makes it easy to know where to resume replication on the new master, since the global transaction IDs are know throughout the entire replication hierarchy. This is not the case when using old-style replication; in this case the slave knows only the specific file name and offset of the old master server of the last event applied. There is no simple way to guess from this the correct file name and offset on a new master. 2. The state of the slave is recorded in a crash-safe way. The slave keeps track of its current position (the global transaction ID of the last transaction applied) in a system table mysql.rpl_slave_state. If this table is using a transactional storage engine (such as InnoDB, which is the default), then updates to the state is done in the same transaction as the updates to the data. This makes the state crash-safe; if the slave server crashes, crash recovery on restart will make sure that the recorded replication position matches what changes were actually replicated. This is not the case for old-style replication, where the state is recorded in a file relay-log.info, which is updated independently of the actual data changes and can easily get out of sync if the slave server crashes. (This works for DML to transactional tables; non-transactional tables and DDL in general are not crash-safe in MariaDB.) Because of these two benefits, it is generally recommended to use global transaction ID for any replication setups based on MariaDB 10.0 or later. However, old-style replication continues to work as always, so there is no pressing need to change existing setups. Global transaction ID integrates smoothly with old-style replication, and the two can be used freely together in the same replication hierarchy. There is no special configuration needed of the server to start using global transaction ID. However, it must be explicitly set for a slave server with the appropriate CHANGE MASTER option; by default old-style replication is used by a replication slave, to maintain backwards compatibility. B. The concept of global transaction ID A global transaction ID, or GTID for short, consists of three numbers separated with dashes '-'. For example: 0-1-10 - The first number 0 is the domain ID, which is specific for global transaction ID (more on this below). It is a 32-bit unsigned integer. - The second number is the server ID, the same as is also used in old-style replication. It is a 32-bit unsigned integer. - The third number is the sequence number. This is a 64-bit unsigned integer that is monotonically increasing for each new event group logged into the binlog. The server ID is set to the server ID of the server where the event group is first logged into the binlog. The sequence number is increased on a server for every event group logged. Since server IDs must be unique for every server, this makes the (server_id, sequence_number) pair, and hence the whole GTID, globally unique. B.1. The domain ID When events are replicated from a master server to a slave server, the events are always logged into the slave's binlog in the same order that they were read from the master's binlog. Thus, if there is only ever a single master server receiving (non-replication) updates at a time, then the binlog order will be idential on every server in the replication hierarchy. This consistent binlog order is used by the slave to keep track of its current position in the replication. Basically, the slave remembers the GTID of the last event group replicated from the master. When reconnecting to a master, whether the same one or a new one, it sends this GTID position to the master, and the master starts sending events from the first event after the corresponding event group. However, if user updates are done independently on multiple servers at the same time, then in general it is not possible for binlog order to be identical across all servers. This can happen when using multi-source replication, with multi-master ring topologies, or just if manual updates are done on a slave that is replicating from active master. If the binlog order is different on the new master from the order on the old master, then it is not sufficient for the slave to keep track of a single GTID to completely record the current state. The domain ID, the first component of the GTID, is used to handle this. In general, the binlog is not a single ordered stream. Rather, it consists of a number of different streams, each one identified by its own domain ID. Within each stream, GTIDs always have the same order in every server binlog. However, different streams can be interleaved in different ways on different servers. A slave server then keeps track of its replication position by recording the last GTID applied within each replication stream. When connecting to a new master, the slave can start replication from a different point in the binlog for each domain ID. For more details on using multi-master setups and multiple domain IDs, see section "F. Using global transaction with multi-source replication and other multi-master setups". Simple replication setups only have a single master being updated by the application at any one time. In such setups, there is only a single replication stream needed. Then domain ID can be ignored, and left as the default of 0 on all servers. C. Using global transaction ID In MariaDB 10.0, global transaction ID is enabled automaticall. Each event group logged to the binlog receives a GTID event, as can be seen with mysqlbinlog or SHOW BINLOG EVENTS. The slave automatically keeps track of the GTID of the last applied event group, as can be seen from the gtid_pos variable: SELECT @@GLOBAL.gtid_pos 0-1-1 When a slave connects to a master, it can use either global transaction ID or old-style filename/offset to decide where in the master binlogs to start replicating from. To use global transaction ID, use the master_use_gtid option of CHANGE MASTER: CHANGE MASTER TO master_use_gtid = 1, master_host = 'my_master', ... When the slave is then later started with START SLAVE, it will send the value of @@GLOBAL.gtid_pos to the master and start replication from the corresponding point in the master binlogs. Even when a slave is configured to connect with the old-style binlog filename and offset (CHANGE MASTER TO master_log_file=..., master_log_pos=...), it will still keep track of the current GTID position in @@GLOBAL.gtid_pos. This means that an existing slave previously configured and running can be changed to connect with GTID (to the same or a new master) simply with: CHANGE MASTER TO master_use_gtid = 1 The slave remembers that master_use_gtid=1 was specified and will use it also for subsequent connects, until it is explicitly changed by specifying master_log_file/pos=... or master_use_gtid=0. The current value can be seen as the field Using_Gtid of SHOW SLAVE STATUS: SHOW SLAVE STATUS Using_Gtid: 1 The slave server internally uses the table mysql.rpl_slave_state to store the GTID position (and so preserve the value of @@GLOBAL.gtid_pos across server restarts). After upgrading a server to 10.0, it is necessary to run mysql_upgrade_db (as always) to get the table created. In order to be crash-safe, this table must use a transactional storage engine such as InnoDB. When MariaDB is first installed (or upgraded to 10.0), the table is created using the default storage engine - which itself defaults to InnoDB. If there is a need to change the storage engine for this table (to make it transactional on a system configured with MyISAM as the default storage engine, for example), use ALTER TABLE: ALTER TABLE mysql.rpl_slave_state ENGINE = InnoDB The table mysql.rpl_slave_state should not be modified in any other way. In particular, do not try to update the rows in the table to change the slave's idea of the current GTID position; instead use SET GLOBAL gtid_pos = '0-1-1' The actual slave GTID position, and thus the value of @@GLOBAL.gtid_pos, is the result of a combination of the contents of the mysql.rpl_slave_state and the contents of the slave binlog (if any, eg. if --log-slave-updates is enabled). This allows to use the same CHANGE MASTER TO ... MASTER_USE_GTID=1 command to connect a server as slave to a new master, regardless of whether the server was acting as a slave or a master before. D. Setting up a new slave server with global transaction ID Setting up a new replication slave server with global transaction ID is not much different from setting up an old-style slave. The basic steps are: 1. Setup the new server and load it with the initial data. 2. Start the slave replicating from the appropriate point in the master's binlog. D.1. Start with empty server, replicate all binary logs The simplest way for testing purposes is probably to setup a new, empty slave server and replicate all of the master's binlogs from the start (this is usually not feasible in a realistic production setup, as the initial binlog files will probably have been purged or take too long to apply). The slave server is installed in the normal way. By default, the GTID position for a newly installed server is empty, which makes the slave replicate from the start of the master's binlogs. But if the slave was used for other purposes before, the initial position can be explicitly set to empty first: SET GLOBAL gtid_pos = ""; Next, point the slave to the master with CHANGE MASTER. Specify master_host etc. as usual. But instead of specifying master_log_file and master_log_pos manually, use master_use_gtid=1 to have GTID do it automatically: CHANGE MASTER TO master_host="127.0.0.1", master_port=3310, master_user="root", master_use_gtid=1; START SLAVE; D.2. Setting up a new slave from a backup The normal way to set up a new replication slave is to restore a backup from an existing server (whether master or slave) as the new server, then point it to start replication from the appropriate position in the master's binlog. It is important that the position at which replication is started corresponds exactly to the state of the data at the point in time that the backup was taken. Otherwise, the slave can end up with different data than the master because of transactions missing or duplicated. Two common ways to take a backup are XtraBackup and mysqldump. Both of these can provide the current binlog position of the backup in a non-blocking way. Of course, if there are no writes to the server being backed up during the backup process, then a simple SHOW MASTER STATUS will give the correct position. Once the current binlog position for the backup has been obtained, in the form of a binlog file name and offset, the corresponding GTID position can be obtained from BINLOG_GTID_POS() on the server that was backed up: SELECT BINLOG_GTID_POS("master-bin.000001", 600); The new slave can now be started replicating by setting the correct @@gtid_pos, issuing CHANGE MASTER to point to the master server, and starting the slave threads: SET GLOBAL gtid_pos = "0-1-2"; CHANGE MASTER TO master_host="127.0.0.1", master_port=3310, master_user="root", master_use_gtid=1; START SLAVE; This method is particularly useful when setting up a new slave from a backup of the master. Remember to ensure that the value of server_id for the new server is different from that of any other server (this is set in my.cnf). If the backup was taken of an existing slave server, then it already has the correct GTID position stored in the table mysql.rpl_slave_state (provided that the backup includes this table and is consistent with changes to other tables, of course). In this case, there is no need to explicitly look up the GTID position on the old server and set it on the new slave - it will be already correctly loaded from mysql.rpl_slave_state. This however does not work if the backup was taken of the master - because then the current GTID position is contained in the binlog, not in mysql.rpl_slave_state. D.3. Switching an existing old-style slave to use GTID. If there is already an existing slave running using old-style binlog filename/offset position, then this can be changed to use GTID directly. This can be useful for upgrades for example, or where there are already tools to setup new slaves using old-style binlog positions. When a slave connects to a master using old-style binlog positions, and the master supports GTID (ie. is MariaDB 10.0.2 or bigger), then the slave automatically downloads the GTID position at connect and updates it during replication. Thus, once a slave has connected to the GTID-aware master at least once, it can be switched to using GTID without any other actions needed; STOP SLAVE; CHANGE MASTER TO master_host="127.0.0.1", master_port=3310, master_user="root", master_use_gtid=1; START SLAVE; (A later version will probably add a way to setup the slave so that it will connect with old-style binlog file/offset the first time, and automatically switch to using GTID on subsequent connects.) E. Changing a slave to replicate from a different master Once replication is running with GTID (master_use_gtid=1), the slave can be pointed to a new master simply by specifying in CHANGE MASTER the new master_host (and if required master_port, master_user, and master_password): STOP SLAVE; CHANGE MASTER TO master_host='127.0.0.1', master_port=3312; START SLAVE; The slave has a record of the GTID of the last applied transaction from the old master, and since GTIDs are identical across all servers in a replication hierarchy, the slave will just continue from the appropriate point in the new master's binlog. It is important to understand how this change of masters work. The binlog is an ordered stream of events (or multiple streams, one per replication domain, see section "F. Using global transaction with multi-source replication and other multi-master setups"). Events within the stream are always applied in the same order on every slave that replicates it. The MariaDB GTID relies on this ordering, so that it is sufficient to remember just a single point within the stream. Since event order is the same on every server, switching to the point of the same GTID in the binlog of another server will give the same result. This translates into some responsibility for the user. The MariaDB GTID replication is fully asynchronous, and fully flexible in how it can be configured. This makes it possible to use it in ways where the assumption that binlog sequence is the same on all servers is violated. In such cases, when changing master, GTID will still attempt to continue at the point of current GTID in the new binlog. The most common way that binlog sequence gets different between servers is when the user/DBA does updates directly on a slave server (and these updates are written into the slaves binlog). This results in events in the slaves binlog that are not present on the master or any other slaves. This can be avoided by setting the session variable sql_log_bin false while doing such updates, so they do not go into the binlog. It is normally best to avoid any differences in binlogs between servers. That being said, MariaDB replication is designed for maximum flexibility, and there can be valid reasons for introducing such differences from time to time. It this case, it just needs to be understood that the GTID position is a single point in each binlog stream (one per replication domain), and how this affects the users particular setup. Differences can also occur when two masters are active at the same time in a replication hierarchy. This happens when using a multi-master ring. But it can also occur in a simple master-slave setup, during switch to a new master, if changes on the old master is not allowed to fully replicate to all slave servers before switching master. Normally, to switch master, first writes to the old master should be stopped, then one should wait for all changes to be replicated to the new master, and only then should writes begin on the new master. Deliberately using multiple active masters is also supported, this is described in the next section. F. Using global transaction with multi-source replication and other multi-master setups MariaDB global transaction ID supports having multiple masters active at the same time. Typically this happens with either multi-source replication or multi-master ring setups. In such setups, each active master must be configured with its own distinct replication domain ID, gtid_domain_id. The binlog will then in effect consists of multiple independent streams, one per active master. Within one replication domain, binlog order is always the same on every server. But two different streams can be interleaved differently in different server binlogs. The GTID position of a given slave is then not a single GTID. Rather, it becomes the GTID of the last event group applied for each value of domain ID, in effect the position reached in each binlog stream. When the slave connects to a master, it can continue from one stream in a different binlog position than another stream. Since order within one stream is consistent across all servers, this is sufficient to always be able to continue replicationat the correct point in any new master server(s). Domain IDs are assigned by the DBA, according to the need of the application. The default value of @@GLOBAL.gtid_domain_id is 0. This is appropriate for most replication setups, where only a single master is active at a time. The MariaDB server will never by itself introduce new domain_id values into the binlog. When using multi-source replication, where a single slave connects to multiple masters at the same time, each such master should be configured with its own distict domain ID. Similarly, in a multi-master ring topology, where all master in the ring are updated by the application concurrently (with some mechanism to avoid conflicts), a distict domain ID should be configured for each server (In a multi-master ring where the application is careful to only do updates on one master at a time, a single domain ID is sufficient). Normally, a slave server should not receive direct updates (as this creates binlog differences compared to the master). Thus it does not matter what value of gtid_domain_id is set on a slave, though it may make sense to make it the same as the master (if not using multi-master) to make it easy to promote the slave as a new master. Of course, if a slave is itself an active master, as in a multi-master ring topology, the domain ID should be set according to the server's role as active master. Note that domain ID and server ID are distinct concepts. It is possible to use a different domain ID on each server, but this is normally not desirable. It makes the current GTID position (@@global.gtid_pos) more complicated to understand and work with, and looses the concept of a single ordered binlog stream across all servers. It is recommended only to configure as many domain IDs as there are master servers actively being updated by the application at the same time. It is not an error in itself to configure domain IDs incorrectly (for example, not configuring them at all). For example, this will be typical in an upgrade scenario where a multi-master ring using 5.5 is upgraded to 10.0. The ring will continue to work as before even though everything is configured to use the default domain ID 0. It is even possible to use GTID for replication between the servers. However, case must be taken when switching a slave to a different master. If the binlog order between the old and the new master differs, then a single GTID position to start replication from in the new master's binlog may not be sufficient. G. New syntax for global transaction ID G.1. CHANGE MASTER CHANGE MASTER has a new option, master_use_gtid=[0|1]. When enabled (set to 1), the slave will connect to the master using the GTID position. When disabled, the old-style binlog filename/offset position is used to decide where to start replicating when connecting. The value of master_use_gtid is saved across server restarts (in master.info). The current value can be seen as the field Using_Gtid in the output of SHOW SLAVE STATUS. G.2. BINLOG_GTID_POS(). The BINLOG_GTID_POS() function takes as input an old-style binlog position in the form of a file name and a file offset. It looks up the position in the current binlog, and returns a string representation of the corresponding GTID position. If the position is not found in the current binlog, NULL is returned. H. New system variables for global transaction ID H.1. gtid_pos This variable is the current GTID position of a slave server. It can be set by the user to change the current replication position. This requires all slave threads to be stopped first. Note that the position is shared among all slave connections when using multi-source replication. To set position for two masters, one using replication domain 1 and another replication domain 2, set a GTID for both domains, for example: SET GLOBAL gtid_pos = "1-10-100,2-20-500"; The variable value is updated whenever an event group is replicated on a slave, and whenever something is logged to the binlog on the master. Note that the value of the variable is the result of whatever event happened last, either slave replication or master binlogging, per replication domain. It is an error to set it to something that conflicts with what is in the binlog. This means that to completely reset a slave server (RESET SLAVE and delete all tables), it is also necessary to RESET MASTER before @@GLOBAL.gtid_pos can be cleared (if binlogging is enabled on the slave). This is in any case necessary to avoid incorrect binlog on the slave. Name: gtid_pos Type: String Scope: global Privileged: yes Dynamic: yes H.2. gtid_domain_id This variable is used to decide which replication domain new GTIDs are logged in for a master server. See section "F. Using global transaction with multi-source replication and other multi-master setups" for details. This variable can also be set on the session level. This is used by mysqlbinlog to preserve the domain ID of GTID events. Name: gtid_domain_id Type: 32-bit unsigned integer Scope: global and session Privileged: yes Dynamic: yes H.3. server_id Server_id can be set on the session level to change which server_id value is logged in binlog events (both GTID and other events). This is used by mysqlbinlog to preserve the server ID of GTID events. Name: server_id Type: 32-bit unsigned integer Scope: global and session Privileged: yes Dynamic: yes H.3. gtid_seq_no gtid_seq_no can be set on the session level to change which sequence number is logged in the following GTID event. This is used by mysqlbinlog to preserve the sequence number of GTID events. Name: gtid_seq_no Type: 64-bit unsigned integer Scope: session only Privileged: yes Dynamic: yes
Hi Kristian, Thanks. I will have a look as soon as I have some time. I need just a piece of information: is this syntax applicable to the current binaries, or do I need to recompile after a specific revision in the code? Cheers Giuseppe On Monday, May 6, 2013 at 15:55 , Kristian Nielsen wrote:
Kristian Nielsen <knielsen@knielsen-hq.org (mailto:knielsen@knielsen-hq.org)> writes:
I will try to get some initial docs written up by the end of the week.
Giuseppe, here (attached) is my first stab at documentation for MariaDB GTID. Thanks for prodding me to get this done, even if it was a very gentle prodding :-)
Daniel, do you think you can get these formatted properly and included in some appropriate place in the Knowledgebase? And feel free to fix any problems you find in the text on the way, of course.
I will then make sure to keep this updated as the code progresses.
This is just a first stab, I am sure there is much that is incomplete and I will work to extend it as needed (comments welcome if anything is found missing).
- Kristian. A. MariaDB global transaction ID
From version 10.0, MariaDB supports global transaction IDs for replication.
MariaDB replication in general works as follows: On a master server, all updates to the database (DML and DDL) are written into the binary log as binlog events. A slave server connects to the master and reads the binlog events, then applies the events locally to replicate the same changes as done on the master. A server can be both a master and a slave at the same time, and it is thus possible for binlog events to replicated through multiple levels of servers.
A slave server keeps track of the position in the master's binlog of the last event applied on the slave. This allows the slave server to re-connect and resume from where it left off after replication has been temporarily stopped. It also allows to disconnect from the master server and connect to a different server to resume replication from a new master, as long as the new master has the proper binlog events, and the new master connection starts replicationg at the appropriate point in the binlogs.
Global transaction ID introduces a new event attached to each event group in the binlog. (An event group is a collection of events that are always applied as a unit. They are best thought of as a "transaction", though they also include non-transactional DML statements, as well as DDL). As an event group is replicated from master server to slave server, the global transaction ID is preserved. Since the ID is globally unique across the entire group of servers, this makes it easy to uniquely identify the same binlog events on different servers that replicate each other (this was not easily possible before MariaDB 10.0).
Using global transaction ID provides two main benefits:
1. Easy to change a slave server to connect to and replicate from a different master server.
The slave remembers the global transaction ID of the last event group applied from the old master. This makes it easy to know where to resume replication on the new master, since the global transaction IDs are know throughout the entire replication hierarchy. This is not the case when using old-style replication; in this case the slave knows only the specific file name and offset of the old master server of the last event applied. There is no simple way to guess from this the correct file name and offset on a new master.
2. The state of the slave is recorded in a crash-safe way.
The slave keeps track of its current position (the global transaction ID of the last transaction applied) in a system table mysql.rpl_slave_state. If this table is using a transactional storage engine (such as InnoDB, which is the default), then updates to the state is done in the same transaction as the updates to the data. This makes the state crash-safe; if the slave server crashes, crash recovery on restart will make sure that the recorded replication position matches what changes were actually replicated. This is not the case for old-style replication, where the state is recorded in a file relay-log.info (http://relay-log.info), which is updated independently of the actual data changes and can easily get out of sync if the slave server crashes. (This works for DML to transactional tables; non-transactional tables and DDL in general are not crash-safe in MariaDB.)
Because of these two benefits, it is generally recommended to use global transaction ID for any replication setups based on MariaDB 10.0 or later. However, old-style replication continues to work as always, so there is no pressing need to change existing setups. Global transaction ID integrates smoothly with old-style replication, and the two can be used freely together in the same replication hierarchy. There is no special configuration needed of the server to start using global transaction ID. However, it must be explicitly set for a slave server with the appropriate CHANGE MASTER option; by default old-style replication is used by a replication slave, to maintain backwards compatibility.
B. The concept of global transaction ID
A global transaction ID, or GTID for short, consists of three numbers separated with dashes '-'. For example:
0-1-10
- The first number 0 is the domain ID, which is specific for global transaction ID (more on this below). It is a 32-bit unsigned integer.
- The second number is the server ID, the same as is also used in old-style replication. It is a 32-bit unsigned integer.
- The third number is the sequence number. This is a 64-bit unsigned integer that is monotonically increasing for each new event group logged into the binlog.
The server ID is set to the server ID of the server where the event group is first logged into the binlog. The sequence number is increased on a server for every event group logged. Since server IDs must be unique for every server, this makes the (server_id, sequence_number) pair, and hence the whole GTID, globally unique.
B.1. The domain ID
When events are replicated from a master server to a slave server, the events are always logged into the slave's binlog in the same order that they were read from the master's binlog. Thus, if there is only ever a single master server receiving (non-replication) updates at a time, then the binlog order will be idential on every server in the replication hierarchy.
This consistent binlog order is used by the slave to keep track of its current position in the replication. Basically, the slave remembers the GTID of the last event group replicated from the master. When reconnecting to a master, whether the same one or a new one, it sends this GTID position to the master, and the master starts sending events from the first event after the corresponding event group.
However, if user updates are done independently on multiple servers at the same time, then in general it is not possible for binlog order to be identical across all servers. This can happen when using multi-source replication, with multi-master ring topologies, or just if manual updates are done on a slave that is replicating from active master. If the binlog order is different on the new master from the order on the old master, then it is not sufficient for the slave to keep track of a single GTID to completely record the current state.
The domain ID, the first component of the GTID, is used to handle this.
In general, the binlog is not a single ordered stream. Rather, it consists of a number of different streams, each one identified by its own domain ID. Within each stream, GTIDs always have the same order in every server binlog. However, different streams can be interleaved in different ways on different servers.
A slave server then keeps track of its replication position by recording the last GTID applied within each replication stream. When connecting to a new master, the slave can start replication from a different point in the binlog for each domain ID.
For more details on using multi-master setups and multiple domain IDs, see section "F. Using global transaction with multi-source replication and other multi-master setups".
Simple replication setups only have a single master being updated by the application at any one time. In such setups, there is only a single replication stream needed. Then domain ID can be ignored, and left as the default of 0 on all servers.
C. Using global transaction ID
In MariaDB 10.0, global transaction ID is enabled automaticall. Each event group logged to the binlog receives a GTID event, as can be seen with mysqlbinlog or SHOW BINLOG EVENTS.
The slave automatically keeps track of the GTID of the last applied event group, as can be seen from the gtid_pos variable:
SELECT @@GLOBAL.gtid_pos 0-1-1
When a slave connects to a master, it can use either global transaction ID or old-style filename/offset to decide where in the master binlogs to start replicating from. To use global transaction ID, use the master_use_gtid option of CHANGE MASTER:
CHANGE MASTER TO master_use_gtid = 1, master_host = 'my_master', ...
When the slave is then later started with START SLAVE, it will send the value of @@GLOBAL.gtid_pos to the master and start replication from the corresponding point in the master binlogs.
Even when a slave is configured to connect with the old-style binlog filename and offset (CHANGE MASTER TO master_log_file=..., master_log_pos=...), it will still keep track of the current GTID position in @@GLOBAL.gtid_pos. This means that an existing slave previously configured and running can be changed to connect with GTID (to the same or a new master) simply with:
CHANGE MASTER TO master_use_gtid = 1
The slave remembers that master_use_gtid=1 was specified and will use it also for subsequent connects, until it is explicitly changed by specifying master_log_file/pos=... or master_use_gtid=0. The current value can be seen as the field Using_Gtid of SHOW SLAVE STATUS:
SHOW SLAVE STATUS Using_Gtid: 1
The slave server internally uses the table mysql.rpl_slave_state to store the GTID position (and so preserve the value of @@GLOBAL.gtid_pos across server restarts). After upgrading a server to 10.0, it is necessary to run mysql_upgrade_db (as always) to get the table created.
In order to be crash-safe, this table must use a transactional storage engine such as InnoDB. When MariaDB is first installed (or upgraded to 10.0), the table is created using the default storage engine - which itself defaults to InnoDB. If there is a need to change the storage engine for this table (to make it transactional on a system configured with MyISAM as the default storage engine, for example), use ALTER TABLE:
ALTER TABLE mysql.rpl_slave_state ENGINE = InnoDB
The table mysql.rpl_slave_state should not be modified in any other way. In particular, do not try to update the rows in the table to change the slave's idea of the current GTID position; instead use
SET GLOBAL gtid_pos = '0-1-1'
The actual slave GTID position, and thus the value of @@GLOBAL.gtid_pos, is the result of a combination of the contents of the mysql.rpl_slave_state and the contents of the slave binlog (if any, eg. if --log-slave-updates is enabled). This allows to use the same CHANGE MASTER TO ... MASTER_USE_GTID=1 command to connect a server as slave to a new master, regardless of whether the server was acting as a slave or a master before.
D. Setting up a new slave server with global transaction ID
Setting up a new replication slave server with global transaction ID is not much different from setting up an old-style slave. The basic steps are:
1. Setup the new server and load it with the initial data.
2. Start the slave replicating from the appropriate point in the master's binlog.
D.1. Start with empty server, replicate all binary logs
The simplest way for testing purposes is probably to setup a new, empty slave server and replicate all of the master's binlogs from the start (this is usually not feasible in a realistic production setup, as the initial binlog files will probably have been purged or take too long to apply).
The slave server is installed in the normal way. By default, the GTID position for a newly installed server is empty, which makes the slave replicate from the start of the master's binlogs. But if the slave was used for other purposes before, the initial position can be explicitly set to empty first:
SET GLOBAL gtid_pos = "";
Next, point the slave to the master with CHANGE MASTER. Specify master_host etc. as usual. But instead of specifying master_log_file and master_log_pos manually, use master_use_gtid=1 to have GTID do it automatically:
CHANGE MASTER TO master_host="127.0.0.1", master_port=3310, master_user="root", master_use_gtid=1; START SLAVE;
D.2. Setting up a new slave from a backup
The normal way to set up a new replication slave is to restore a backup from an existing server (whether master or slave) as the new server, then point it to start replication from the appropriate position in the master's binlog.
It is important that the position at which replication is started corresponds exactly to the state of the data at the point in time that the backup was taken. Otherwise, the slave can end up with different data than the master because of transactions missing or duplicated.
Two common ways to take a backup are XtraBackup and mysqldump. Both of these can provide the current binlog position of the backup in a non-blocking way. Of course, if there are no writes to the server being backed up during the backup process, then a simple SHOW MASTER STATUS will give the correct position.
Once the current binlog position for the backup has been obtained, in the form of a binlog file name and offset, the corresponding GTID position can be obtained from BINLOG_GTID_POS() on the server that was backed up:
SELECT BINLOG_GTID_POS("master-bin.000001", 600);
The new slave can now be started replicating by setting the correct @@gtid_pos, issuing CHANGE MASTER to point to the master server, and starting the slave threads:
SET GLOBAL gtid_pos = "0-1-2"; CHANGE MASTER TO master_host="127.0.0.1", master_port=3310, master_user="root", master_use_gtid=1; START SLAVE;
This method is particularly useful when setting up a new slave from a backup of the master. Remember to ensure that the value of server_id for the new server is different from that of any other server (this is set in my.cnf).
If the backup was taken of an existing slave server, then it already has the correct GTID position stored in the table mysql.rpl_slave_state (provided that the backup includes this table and is consistent with changes to other tables, of course). In this case, there is no need to explicitly look up the GTID position on the old server and set it on the new slave - it will be already correctly loaded from mysql.rpl_slave_state. This however does not work if the backup was taken of the master - because then the current GTID position is contained in the binlog, not in mysql.rpl_slave_state.
D.3. Switching an existing old-style slave to use GTID.
If there is already an existing slave running using old-style binlog filename/offset position, then this can be changed to use GTID directly. This can be useful for upgrades for example, or where there are already tools to setup new slaves using old-style binlog positions.
When a slave connects to a master using old-style binlog positions, and the master supports GTID (ie. is MariaDB 10.0.2 or bigger), then the slave automatically downloads the GTID position at connect and updates it during replication. Thus, once a slave has connected to the GTID-aware master at least once, it can be switched to using GTID without any other actions needed;
STOP SLAVE; CHANGE MASTER TO master_host="127.0.0.1", master_port=3310, master_user="root", master_use_gtid=1; START SLAVE;
(A later version will probably add a way to setup the slave so that it will connect with old-style binlog file/offset the first time, and automatically switch to using GTID on subsequent connects.)
E. Changing a slave to replicate from a different master
Once replication is running with GTID (master_use_gtid=1), the slave can be pointed to a new master simply by specifying in CHANGE MASTER the new master_host (and if required master_port, master_user, and master_password):
STOP SLAVE; CHANGE MASTER TO master_host='127.0.0.1', master_port=3312; START SLAVE;
The slave has a record of the GTID of the last applied transaction from the old master, and since GTIDs are identical across all servers in a replication hierarchy, the slave will just continue from the appropriate point in the new master's binlog.
It is important to understand how this change of masters work. The binlog is an ordered stream of events (or multiple streams, one per replication domain, see section "F. Using global transaction with multi-source replication and other multi-master setups"). Events within the stream are always applied in the same order on every slave that replicates it. The MariaDB GTID relies on this ordering, so that it is sufficient to remember just a single point within the stream. Since event order is the same on every server, switching to the point of the same GTID in the binlog of another server will give the same result.
This translates into some responsibility for the user. The MariaDB GTID replication is fully asynchronous, and fully flexible in how it can be configured. This makes it possible to use it in ways where the assumption that binlog sequence is the same on all servers is violated. In such cases, when changing master, GTID will still attempt to continue at the point of current GTID in the new binlog.
The most common way that binlog sequence gets different between servers is when the user/DBA does updates directly on a slave server (and these updates are written into the slaves binlog). This results in events in the slaves binlog that are not present on the master or any other slaves. This can be avoided by setting the session variable sql_log_bin false while doing such updates, so they do not go into the binlog.
It is normally best to avoid any differences in binlogs between servers. That being said, MariaDB replication is designed for maximum flexibility, and there can be valid reasons for introducing such differences from time to time. It this case, it just needs to be understood that the GTID position is a single point in each binlog stream (one per replication domain), and how this affects the users particular setup.
Differences can also occur when two masters are active at the same time in a replication hierarchy. This happens when using a multi-master ring. But it can also occur in a simple master-slave setup, during switch to a new master, if changes on the old master is not allowed to fully replicate to all slave servers before switching master. Normally, to switch master, first writes to the old master should be stopped, then one should wait for all changes to be replicated to the new master, and only then should writes begin on the new master. Deliberately using multiple active masters is also supported, this is described in the next section.
F. Using global transaction with multi-source replication and other multi-master setups
MariaDB global transaction ID supports having multiple masters active at the same time. Typically this happens with either multi-source replication or multi-master ring setups.
In such setups, each active master must be configured with its own distinct replication domain ID, gtid_domain_id. The binlog will then in effect consists of multiple independent streams, one per active master. Within one replication domain, binlog order is always the same on every server. But two different streams can be interleaved differently in different server binlogs.
The GTID position of a given slave is then not a single GTID. Rather, it becomes the GTID of the last event group applied for each value of domain ID, in effect the position reached in each binlog stream. When the slave connects to a master, it can continue from one stream in a different binlog position than another stream. Since order within one stream is consistent across all servers, this is sufficient to always be able to continue replicationat the correct point in any new master server(s).
Domain IDs are assigned by the DBA, according to the need of the application. The default value of @@GLOBAL.gtid_domain_id is 0. This is appropriate for most replication setups, where only a single master is active at a time. The MariaDB server will never by itself introduce new domain_id values into the binlog.
When using multi-source replication, where a single slave connects to multiple masters at the same time, each such master should be configured with its own distict domain ID.
Similarly, in a multi-master ring topology, where all master in the ring are updated by the application concurrently (with some mechanism to avoid conflicts), a distict domain ID should be configured for each server (In a multi-master ring where the application is careful to only do updates on one master at a time, a single domain ID is sufficient).
Normally, a slave server should not receive direct updates (as this creates binlog differences compared to the master). Thus it does not matter what value of gtid_domain_id is set on a slave, though it may make sense to make it the same as the master (if not using multi-master) to make it easy to promote the slave as a new master. Of course, if a slave is itself an active master, as in a multi-master ring topology, the domain ID should be set according to the server's role as active master.
Note that domain ID and server ID are distinct concepts. It is possible to use a different domain ID on each server, but this is normally not desirable. It makes the current GTID position (@@global.gtid_pos) more complicated to understand and work with, and looses the concept of a single ordered binlog stream across all servers. It is recommended only to configure as many domain IDs as there are master servers actively being updated by the application at the same time.
It is not an error in itself to configure domain IDs incorrectly (for example, not configuring them at all). For example, this will be typical in an upgrade scenario where a multi-master ring using 5.5 is upgraded to 10.0. The ring will continue to work as before even though everything is configured to use the default domain ID 0. It is even possible to use GTID for replication between the servers. However, case must be taken when switching a slave to a different master. If the binlog order between the old and the new master differs, then a single GTID position to start replication from in the new master's binlog may not be sufficient.
G. New syntax for global transaction ID
G.1. CHANGE MASTER
CHANGE MASTER has a new option, master_use_gtid=[0|1]. When enabled (set to 1), the slave will connect to the master using the GTID position. When disabled, the old-style binlog filename/offset position is used to decide where to start replicating when connecting.
The value of master_use_gtid is saved across server restarts (in master.info (http://master.info)). The current value can be seen as the field Using_Gtid in the output of SHOW SLAVE STATUS.
G.2. BINLOG_GTID_POS().
The BINLOG_GTID_POS() function takes as input an old-style binlog position in the form of a file name and a file offset. It looks up the position in the current binlog, and returns a string representation of the corresponding GTID position. If the position is not found in the current binlog, NULL is returned.
H. New system variables for global transaction ID
H.1. gtid_pos
This variable is the current GTID position of a slave server.
It can be set by the user to change the current replication position. This requires all slave threads to be stopped first. Note that the position is shared among all slave connections when using multi-source replication. To set position for two masters, one using replication domain 1 and another replication domain 2, set a GTID for both domains, for example:
SET GLOBAL gtid_pos = "1-10-100,2-20-500";
The variable value is updated whenever an event group is replicated on a slave, and whenever something is logged to the binlog on the master.
Note that the value of the variable is the result of whatever event happened last, either slave replication or master binlogging, per replication domain. It is an error to set it to something that conflicts with what is in the binlog. This means that to completely reset a slave server (RESET SLAVE and delete all tables), it is also necessary to RESET MASTER before @@GLOBAL.gtid_pos can be cleared (if binlogging is enabled on the slave). This is in any case necessary to avoid incorrect binlog on the slave.
Name: gtid_pos Type: String Scope: global Privileged: yes Dynamic: yes
H.2. gtid_domain_id
This variable is used to decide which replication domain new GTIDs are logged in for a master server. See section "F. Using global transaction with multi-source replication and other multi-master setups" for details.
This variable can also be set on the session level. This is used by mysqlbinlog to preserve the domain ID of GTID events.
Name: gtid_domain_id Type: 32-bit unsigned integer Scope: global and session Privileged: yes Dynamic: yes
H.3. server_id
Server_id can be set on the session level to change which server_id value is logged in binlog events (both GTID and other events). This is used by mysqlbinlog to preserve the server ID of GTID events.
Name: server_id Type: 32-bit unsigned integer Scope: global and session Privileged: yes Dynamic: yes
H.3. gtid_seq_no
gtid_seq_no can be set on the session level to change which sequence number is logged in the following GTID event. This is used by mysqlbinlog to preserve the sequence number of GTID events.
Name: gtid_seq_no Type: 64-bit unsigned integer Scope: session only Privileged: yes Dynamic: yes
Hi Kristian, Daniel
here (attached) is my first stab at documentation for MariaDB GTID.
good stuff! A few comments: In the section describing existing classic replication:
A slave server keeps track of the position in the master's binlog of the last event applied on the slave. This allows the slave server to re-connect and resume from where it left off after replication has been temporarily stopped.
It also allows to disconnect from the master server and connect to a different server to resume replication from a new master, as long as the new master has the proper binlog events, and the new master connection starts replicationg at the appropriate point in the binlogs.
The second sentence tends to never be true in the real world. The instances where two masters run at exactly the same binlog/pos are minimal to nonexistent. I suggest the following to replace: "It also allows a slave to disconnect, be cloned and then have the new slave resume replication from the same master." You really can't guarantee any more. Then, later on:
In order to be crash-safe, this table must use a transactional storage engine such as InnoDB. When MariaDB is first installed (or upgraded to 10.0), the table is created using the default storage engine - which itself defaults to InnoDB.
Hmm - I understand the reasoning for this logic, but I'd prefer it to explicitly choose InnoDB rather than go for the engine default. Otherwise, with silly old configs on systems that we find in the real world, the initial upgrade can see the system end up not-crashsafe but without that being immediately obvious. Historically, it's things like that tend to cause "bad publicity" (people writing negative blog articles, etc). Perhaps this is not fixable without possibly having an upgrade process break, which is even less desirable. But if there is another viable route, please consider. thanks Regards, Arjen. -- Arjen Lentz, Exec.Director @ Open Query (http://openquery.com) Australian peace of mind for your MySQL/MariaDB infrastructure. Follow us at http://openquery.com/blog/ & http://twitter.com/openquery
Arjen Lentz <arjen@openquery.com> writes:
In the section describing existing classic replication:
A slave server keeps track of the position in the master's binlog of the last event applied on the slave. This allows the slave server to re-connect and resume from where it left off after replication has been temporarily stopped.
It also allows to disconnect from the master server and connect to a different server to resume replication from a new master, as long as the new master has the proper binlog events, and the new master connection starts replicationg at the appropriate point in the binlogs.
The second sentence tends to never be true in the real world. The instances where two masters run at exactly the same binlog/pos are minimal to nonexistent. I suggest the following to replace:
"It also allows a slave to disconnect, be cloned and then have the new slave resume replication from the same master."
You really can't guarantee any more.
Thanks, I'll update this once the text is in the knowledgebase.
Hmm - I understand the reasoning for this logic, but I'd prefer it to explicitly choose InnoDB rather than go for the engine default. Otherwise, with silly old configs on systems that we find in the real world, the initial upgrade can see the system end up not-crashsafe but without that being immediately obvious. Historically, it's things like that tend to cause "bad publicity" (people writing negative blog articles, etc).
Perhaps this is not fixable without possibly having an upgrade process break, which is even less desirable.
Yeah, it is not trivial to get something that does the right thing in all cases. The main problem is if we end up with a table in InnoDB during mysql_install_db, but then the running server is myisam-only and has InnoDB disabled (--skip-innodb). Then things break badly because the table is now inaccessible. The "default engine" was the best compromise I came up with so far. It seems fairly reasonable, given that InnoDB is the default since 5.5. We still have the problem with silly old configs, but at least eg. .deb default my.cnf does not override the default engine. - Kristian.
Thanks Kristian, very thorough docs! I've formatted and added to the knowledgebase (incorporating Arjen's suggestion) at https://kb.askmonty.org/en/global-transaction-id/ I'll fan out the changes to other affected articles (syntax, server variables, replication) during the week. On 06/05/2013 15:55, Kristian Nielsen wrote:
Giuseppe, here (attached) is my first stab at documentation for MariaDB GTID. Thanks for prodding me to get this done, even if it was a very gentle prodding :-)
Daniel, do you think you can get these formatted properly and included in some appropriate place in the Knowledgebase? And feel free to fix any problems you find in the text on the way, of course.
I will then make sure to keep this updated as the code progresses.
This is just a first stab, I am sure there is much that is incomplete and I will work to extend it as needed (comments welcome if anything is found missing).
Hi Kristian, From the documentation the purpose of domain ID in GTID is quite clear. But what is the role of server ID? Thanks, Alex
Alex Yurchenko <alexey.yurchenko@codership.com> writes:
From the documentation the purpose of domain ID in GTID is quite clear. But what is the role of server ID?
The role is mainly to ensure uniqueness of GTID when domain_id is not configured correctly. Replication already requires server ID to be unique, so (server_id, sequence number) will be globally unique as long as sequence number is increased locally on each server. Domain id is not required to be unique, in fact it will typically be shared by master and slave. It is a common mistake to do a manual transaction on the slave while transactions are also being done at the same time on the master. Having server_id in the GTID prevents that two different transactions end up with the same GTID. - Kristian.
On 2013-05-07 17:13, Kristian Nielsen wrote:
Alex Yurchenko <alexey.yurchenko@codership.com> writes:
From the documentation the purpose of domain ID in GTID is quite clear. But what is the role of server ID?
The role is mainly to ensure uniqueness of GTID when domain_id is not configured correctly.
Since both are configured manually, and domain ID can simply default to 0 in simple setups, I'd imagine that the possibility of having server ID configured incorrectly (just missing to configure it) is way more probable than having domain ID incorrect. Actually, being an arbitrary node group ID what is "incorrect" here? ANY value just makes the node a member of the corresponding domain, so ANY domain ID value is legal. Whereas server ID can certainly be incorrect (a duplicate within the domain).
Replication already requires server ID to be unique, so (server_id, sequence number) will be globally unique as long as sequence number is increased locally on each server.
Domain id is not required to be unique, in fact it will typically be shared by master and slave. It is a common mistake to do a manual transaction on the slave while transactions are also being done at the same time on the master. Having server_id in the GTID prevents that two different transactions end up with the same GTID.
So suppose we have nodes N0, N1 and N2 with IDs 0-0, 0-1, 0-2 respectively. Initially N1 and N2 both replicate from N0 and have identical DB contents. At 0-0-10 N2 goes to maintenance. After 0-0-100 someone executes local transaction on N1 and it gets logged as 0-1-101. Right? So if now N0 executes another transaction, what will be its GTID? a) on N0 - 0-0-101? b) on N1 - 0-0-102 or 0-0-101? (as your documentation states
The server ID is set to the server ID of the server where the event group is first logged into the binlog. The sequence number is increased on a server for every event group logged. So it is actually another question, sequence number is not set on the master server but always computed locally?)
Or, does N1 detect a problem at this point? If yes, how exactly? How server ID is involved there? Now if we can get past this point without an error at N1, and start N2 to replicate from N1, I take it will receive and commit 0-1-101. But will it ever record it somewhere or its state will be simply 0-0-XXX? If at 0-0-110 we failover N0 to replicate from N2, will it receive 0-1-101? Thanks, Alex
- Kristian.
-- Alexey Yurchenko, Codership Oy, www.codership.com Skype: alexey.yurchenko, Phone: +358-400-516-011
Helping Kristian to answer questions (see below). He can elaborate if he wish to. On Tue, May 7, 2013 at 12:52 PM, Alex Yurchenko <alexey.yurchenko@codership.com> wrote:
On 2013-05-07 17:13, Kristian Nielsen wrote:
Alex Yurchenko <alexey.yurchenko@codership.com> writes:
From the documentation the purpose of domain ID in GTID is quite clear. But what is the role of server ID?
The role is mainly to ensure uniqueness of GTID when domain_id is not configured correctly.
Since both are configured manually, and domain ID can simply default to 0 in simple setups, I'd imagine that the possibility of having server ID configured incorrectly (just missing to configure it) is way more probable than having domain ID incorrect. Actually, being an arbitrary node group ID what is "incorrect" here? ANY value just makes the node a member of the corresponding domain, so ANY domain ID value is legal. Whereas server ID can certainly be incorrect (a duplicate within the domain).
Incorrect in this case would be having multi-master replication with independent replication streams having the same domain_id.
Replication already requires server ID to be unique, so (server_id, sequence number) will be globally unique as long as sequence number is increased locally on each server.
Domain id is not required to be unique, in fact it will typically be shared by master and slave. It is a common mistake to do a manual transaction on the slave while transactions are also being done at the same time on the master. Having server_id in the GTID prevents that two different transactions end up with the same GTID.
So suppose we have nodes N0, N1 and N2 with IDs 0-0, 0-1, 0-2 respectively.
Initially N1 and N2 both replicate from N0 and have identical DB contents.
At 0-0-10 N2 goes to maintenance.
After 0-0-100 someone executes local transaction on N1 and it gets logged as 0-1-101. Right?
Right.
So if now N0 executes another transaction, what will be its GTID? a) on N0 - 0-0-101?
Correct.
b) on N1 - 0-0-102 or 0-0-101? (as your documentation states
On N1 it will be the same -- 0-0-101. The purpose of GTID is that the same transaction has the same GTID on each server.
The server ID is set to the server ID of the server where the event group is first logged into the binlog. The sequence number is increased on a server for every event group logged.
So it is actually another question, sequence number is not set on the master server but always computed locally?)
For every transaction replicated from master sequence number is set on the master. For each transaction executed on the slave locally sequence number is generated locally.
Or, does N1 detect a problem at this point? If yes, how exactly?
N1 doesn't detect a problem currently, but Kristian plans to implement a "strict gtid mode" when N1 will detect a problem.
How server ID is involved there?
Server ID is involved in a sense that there's no confusion when you talk about transaction with sequence number 101 in your example above. There are two transactions with sequence number 101 -- 0-0-101 and 0-1-101. So server ID gives distinct GTID to these transactions despite the same sequence number.
Now if we can get past this point without an error at N1, and start N2 to replicate from N1, I take it will receive and commit 0-1-101. But will it ever record it somewhere or its state will be simply 0-0-XXX?
Yes, N2 will receive transaction 0-1-101 and it will put it in binlogs as 0-1-101, the same way as it was on N1.
If at 0-0-110 we failover N0 to replicate from N2, will it receive 0-1-101?
No, if you failover when both N0 and N2 have already 0-0-110 then N0 won't receive 0-1-101 because it will start replication from the first transaction after 0-0-110. OTOH if at 0-0-110 you take N0 out, restore it to the pre- 0-1-101 state and connect to replicate from N2 then N0 will receive 0-1-101. Pavel
Hi Pavel, Thanks for explanation. I was following your discussion about "strict" mode as well. So I guess I can formulate my concerns more or less compactly: 1) Although server ID allows us to distinguish between 0-0-101 and 0-1-101 in the example below, it does not seem to be used for anything useful, but to log events with duplicate sequence numbers within a given domain ID, which, as we know, should not be there. 2) Even the ability to distinguish between 0-0-101 and 0-1-101 seems to not work consistently and be a matter of luck since either one can get lost after a couple of failovers. Why bother at all? So it seems that once you forbid logging of duplicate sequence numbers (making "strict" mode the only mode, at least in this context), you can safely discard server ID from the GTID, no? Regards, Alex On 2013-05-08 02:02, Pavel Ivanov wrote:
Helping Kristian to answer questions (see below). He can elaborate if he wish to.
On Tue, May 7, 2013 at 12:52 PM, Alex Yurchenko <alexey.yurchenko@codership.com> wrote:
On 2013-05-07 17:13, Kristian Nielsen wrote:
Alex Yurchenko <alexey.yurchenko@codership.com> writes:
From the documentation the purpose of domain ID in GTID is quite clear. But what is the role of server ID?
The role is mainly to ensure uniqueness of GTID when domain_id is not configured correctly.
Since both are configured manually, and domain ID can simply default to 0 in simple setups, I'd imagine that the possibility of having server ID configured incorrectly (just missing to configure it) is way more probable than having domain ID incorrect. Actually, being an arbitrary node group ID what is "incorrect" here? ANY value just makes the node a member of the corresponding domain, so ANY domain ID value is legal. Whereas server ID can certainly be incorrect (a duplicate within the domain).
Incorrect in this case would be having multi-master replication with independent replication streams having the same domain_id.
Replication already requires server ID to be unique, so (server_id, sequence number) will be globally unique as long as sequence number is increased locally on each server.
Domain id is not required to be unique, in fact it will typically be shared by master and slave. It is a common mistake to do a manual transaction on the slave while transactions are also being done at the same time on the master. Having server_id in the GTID prevents that two different transactions end up with the same GTID.
So suppose we have nodes N0, N1 and N2 with IDs 0-0, 0-1, 0-2 respectively.
Initially N1 and N2 both replicate from N0 and have identical DB contents.
At 0-0-10 N2 goes to maintenance.
After 0-0-100 someone executes local transaction on N1 and it gets logged as 0-1-101. Right?
Right.
So if now N0 executes another transaction, what will be its GTID? a) on N0 - 0-0-101?
Correct.
b) on N1 - 0-0-102 or 0-0-101? (as your documentation states
On N1 it will be the same -- 0-0-101. The purpose of GTID is that the same transaction has the same GTID on each server.
The server ID is set to the server ID of the server where the event group is first logged into the binlog. The sequence number is increased on a server for every event group logged.
So it is actually another question, sequence number is not set on the master server but always computed locally?)
For every transaction replicated from master sequence number is set on the master. For each transaction executed on the slave locally sequence number is generated locally.
Or, does N1 detect a problem at this point? If yes, how exactly?
N1 doesn't detect a problem currently, but Kristian plans to implement a "strict gtid mode" when N1 will detect a problem.
How server ID is involved there?
Server ID is involved in a sense that there's no confusion when you talk about transaction with sequence number 101 in your example above. There are two transactions with sequence number 101 -- 0-0-101 and 0-1-101. So server ID gives distinct GTID to these transactions despite the same sequence number.
Now if we can get past this point without an error at N1, and start N2 to replicate from N1, I take it will receive and commit 0-1-101. But will it ever record it somewhere or its state will be simply 0-0-XXX?
Yes, N2 will receive transaction 0-1-101 and it will put it in binlogs as 0-1-101, the same way as it was on N1.
If at 0-0-110 we failover N0 to replicate from N2, will it receive 0-1-101?
No, if you failover when both N0 and N2 have already 0-0-110 then N0 won't receive 0-1-101 because it will start replication from the first transaction after 0-0-110. OTOH if at 0-0-110 you take N0 out, restore it to the pre- 0-1-101 state and connect to replicate from N2 then N0 will receive 0-1-101.
Pavel
-- Alexey Yurchenko, Codership Oy, www.codership.com Skype: alexey.yurchenko, Phone: +358-400-516-011
So it seems that once you forbid logging of duplicate sequence numbers (making "strict" mode the only mode, at least in this context), you can safely discard server ID from the GTID, no?
No. Consider your example, but now at 0-0-100 you've got network partition and N1 got disconnected from N0. Then each server executes one transaction, it will be 0-0-101 on N0 and 0-1-101 on N1. Now network is restored and N1 connects to N0 again. If GTID consisted of domain_id and sequence number only then N1 would ask to start replication from 0-101 and N0 will happily do that and will send events starting from 0-0-102. So you'll get a silent loss of one transaction. It shouldn't happen. With current implementation N1 will ask to start replication from 0-1-101, N0 won't find such event and will give an error, which is The Right Thing To Do in such situation. Pavel On Tue, May 7, 2013 at 7:20 PM, Alex Yurchenko <alexey.yurchenko@codership.com> wrote:
Hi Pavel,
Thanks for explanation. I was following your discussion about "strict" mode as well. So I guess I can formulate my concerns more or less compactly:
1) Although server ID allows us to distinguish between 0-0-101 and 0-1-101 in the example below, it does not seem to be used for anything useful, but to log events with duplicate sequence numbers within a given domain ID, which, as we know, should not be there.
2) Even the ability to distinguish between 0-0-101 and 0-1-101 seems to not work consistently and be a matter of luck since either one can get lost after a couple of failovers. Why bother at all?
So it seems that once you forbid logging of duplicate sequence numbers (making "strict" mode the only mode, at least in this context), you can safely discard server ID from the GTID, no?
Regards, Alex
On 2013-05-08 02:02, Pavel Ivanov wrote:
Helping Kristian to answer questions (see below). He can elaborate if he wish to.
On Tue, May 7, 2013 at 12:52 PM, Alex Yurchenko <alexey.yurchenko@codership.com> wrote:
On 2013-05-07 17:13, Kristian Nielsen wrote:
Alex Yurchenko <alexey.yurchenko@codership.com> writes:
From the documentation the purpose of domain ID in GTID is quite clear. But what is the role of server ID?
The role is mainly to ensure uniqueness of GTID when domain_id is not configured correctly.
Since both are configured manually, and domain ID can simply default to 0 in simple setups, I'd imagine that the possibility of having server ID configured incorrectly (just missing to configure it) is way more probable than having domain ID incorrect. Actually, being an arbitrary node group ID what is "incorrect" here? ANY value just makes the node a member of the corresponding domain, so ANY domain ID value is legal. Whereas server ID can certainly be incorrect (a duplicate within the domain).
Incorrect in this case would be having multi-master replication with independent replication streams having the same domain_id.
Replication already requires server ID to be unique, so (server_id, sequence number) will be globally unique as long as sequence number is increased locally on each server.
Domain id is not required to be unique, in fact it will typically be shared by master and slave. It is a common mistake to do a manual transaction on the slave while transactions are also being done at the same time on the master. Having server_id in the GTID prevents that two different transactions end up with the same GTID.
So suppose we have nodes N0, N1 and N2 with IDs 0-0, 0-1, 0-2 respectively.
Initially N1 and N2 both replicate from N0 and have identical DB contents.
At 0-0-10 N2 goes to maintenance.
After 0-0-100 someone executes local transaction on N1 and it gets logged as 0-1-101. Right?
Right.
So if now N0 executes another transaction, what will be its GTID? a) on N0 - 0-0-101?
Correct.
b) on N1 - 0-0-102 or 0-0-101? (as your documentation states
On N1 it will be the same -- 0-0-101. The purpose of GTID is that the same transaction has the same GTID on each server.
The server ID is set to the server ID of the server where the event group is first logged into the binlog. The sequence number is increased on a server for every event group logged.
So it is actually another question, sequence number is not set on the master server but always computed locally?)
For every transaction replicated from master sequence number is set on the master. For each transaction executed on the slave locally sequence number is generated locally.
Or, does N1 detect a problem at this point? If yes, how exactly?
N1 doesn't detect a problem currently, but Kristian plans to implement a "strict gtid mode" when N1 will detect a problem.
How server ID is involved there?
Server ID is involved in a sense that there's no confusion when you talk about transaction with sequence number 101 in your example above. There are two transactions with sequence number 101 -- 0-0-101 and 0-1-101. So server ID gives distinct GTID to these transactions despite the same sequence number.
Now if we can get past this point without an error at N1, and start N2 to replicate from N1, I take it will receive and commit 0-1-101. But will it ever record it somewhere or its state will be simply 0-0-XXX?
Yes, N2 will receive transaction 0-1-101 and it will put it in binlogs as 0-1-101, the same way as it was on N1.
If at 0-0-110 we failover N0 to replicate from N2, will it receive 0-1-101?
No, if you failover when both N0 and N2 have already 0-0-110 then N0 won't receive 0-1-101 because it will start replication from the first transaction after 0-0-110. OTOH if at 0-0-110 you take N0 out, restore it to the pre- 0-1-101 state and connect to replicate from N2 then N0 will receive 0-1-101.
Pavel
-- Alexey Yurchenko, Codership Oy, www.codership.com Skype: alexey.yurchenko, Phone: +358-400-516-011
Alex Yurchenko <alexey.yurchenko@codership.com> writes:
Since both are configured manually, and domain ID can simply default to 0 in simple setups, I'd imagine that the possibility of having server ID configured incorrectly (just missing to configure it) is way more probable than having domain ID incorrect. Actually, being an
Are you sure? Traditional replication has always tried to make sure that server_id is configured to be unique. You cannot even start a slave if server_id is not set. And if the master and slave has same server_id, you get this error when starting the slave: 130508 13:43:04 [ERROR] Slave I/O: Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it). Internal MariaDB error code: 1593
arbitrary node group ID what is "incorrect" here? ANY value just makes the node a member of the corresponding domain, so ANY domain ID value is legal. Whereas server ID can certainly be incorrect (a duplicate within the domain).
Here is how I suggest to think about it: Server_id is assumed to uniquely identify any server, there is some code to help ensure this. Each server keeps a local counter which is guaranteed to increment for each new transaction originating on that server (it can increment with more than 1, but never decrement). This ensures uniqueness of the GTID. The GTID code has the ability to locate any GTID in the binlogs on a server (or detect that the GTID is missing). The slave remembers the last GTID it replicated. This allows a slave to connect to a new master and locate the point in the binlog on the new master that corresponds to where it stopped on the old master. All of this works without any regard to replication domain ID. So in this sense, there is no incorrect configuration of domain ID possible, as you say. But now, on the next level, we consider what happens if the order of transactions in the binlog on the new master differs from that on the old master. If the order is A,B on the old but B,A on the new, and the slave was at point A on the old, then starting at A on the new will loose a transaction B (similarly we can duplicate a transaction). Different binlog order can happen for two reasons. Either by mistake (or sloppyness), or deliberately, due to transactions happening independently in parallel (such as multi-source replication). And we want to deal with both cases. To handle the mistake, I plan to implement a strict mode. Whenever we originate a new transaction on a server and write it to the binlog, we ensure it has a higher sequence number than any previous one. Then, if on replication we receive a transaction from a master where the sequence number is not bigger than the last thing logged in the slave's binlog, we have detected an out-of-order situation, and stop with an error. To handle sloppyness, users can disable strict mode. If they then get out-of-order binlog (because of not obeying read-only slave or something), things will still work (because on the basic level we have the ability to locate any GTID, even if sequence numbers are not strictly increasing). However they need to be careful if they change master around the out-of-order points, as per the A,B / B,A example above. This is no different from old-style replication (and it is required that non-strict be default, to not break upgrade of existing setups). The purpose of domain IDs is to handle the deliberate case. The user/DBA/application needs to explicitly declare that two transactions are intended to be independent, generated in parallel in arbitrary order. This declaration is done by giving independent transactions distinct domain IDs, and using same domain ID for transactions that were intended to be ordered. The slave will then remember one binlog position for every domain ID. This avoids the A,B / B,A problem or related issues, as long as order is in fact preserved within one replication domain (and with strict mode, we can detect mistakes). So the issue of "correct" configuration for domain_is is that any two transactions that can end up in different order in binlogs on different servers, should have different domain ID. A further advantage (for later) is that, knowing that GTIDs 0-1-10 and 1-2-20 are independent (different domain), a slave server is free to replicate then in parallel and commit in any order. This will later be used to implement robust, out-of-order parallel slave. So this is how domain ID should be thought of: it is a declaration, by the user, about which transactions are independent, and which are considered strictly ordered with one another.
So suppose we have nodes N0, N1 and N2 with IDs 0-0, 0-1, 0-2 respectively.
Initially N1 and N2 both replicate from N0 and have identical DB contents.
At 0-0-10 N2 goes to maintenance.
After 0-0-100 someone executes local transaction on N1 and it gets logged as 0-1-101. Right?
Yes.
So if now N0 executes another transaction, what will be its GTID? a) on N0 - 0-0-101?
Yes.
b) on N1 - 0-0-102 or 0-0-101?
0-0-101. (GTIDs are always preserved by replication.)
The server ID is set to the server ID of the server where the event group is first logged into the binlog. The sequence number is increased on a server for every event group logged. So it is actually another question, sequence number is not set on the master server but always computed locally?)
No, this is bad wording on my part. When a new transaction is first created by a user, it gets a new, increased sequence number. But as it replicates between servers, the sequence number is kept.
Or, does N1 detect a problem at this point? If yes, how exactly? How server ID is involved there?
Once strict mode is implemented, it will detect the problem that N1's binlog has 0-1-101. And now replication wants to log another GTID 0-0-101, with a sequence number that is not increasing. With strict mode on, this will be an error (replication will be stopped). I think server ID is not really involved here. It would also be an error to try to log 0-0-101 if the binlog already contained 0-0-101. Server ID is mostly used to be able to locate arbitrary GTID in the binlog, even if sequence numbers happen to be not always increasing.
Now if we can get past this point without an error at N1, and start N2 to replicate from N1, I take it will receive and commit 0-1-101. But
Yes.
will it ever record it somewhere or its state will be simply 0-0-XXX?
Just after applying 0-1-101, the state will be just that, 0-1-101. But then as we proceed with 0-0-101 and further 0-0-XXX, the state will simply be 0-0-XXX.
If at 0-0-110 we failover N0 to replicate from N2, will it receive 0-1-101?
No. Because 0-1-101 is before 0-0-110 in the binlog on N2. - Kristian.
On Mon, 06 May 2013 15:55:17 +0200 Kristian Nielsen <knielsen@knielsen-hq.org> wrote: Kristian> Daniel, do you think you can get these formatted properly and Kristian> included in some appropriate place in the Knowledgebase? And Kristian> feel free to fix any problems you find in the text on the Kristian> way, of course. Thanks to Ian Gilfillan (aka greenman), this is now in the Knowledgebase: https://kb.askmonty.org/en/global-transaction-id/ He was making some updates in the replication section of the KB and offered to put this in while he was there. Kristian> I will then make sure to keep this updated as the code Kristian> progresses. Thanks! -- Daniel Bartholomew Google+ - http://gplus.to/dbart Twitter - http://twitter.com/daniel_bart MariaDB: An Enhanced Drop-in Replacement for MySQL Website - http://mariadb.org Twitter - http://twitter.com/mariadb Google+ - http://google.com/+mariadb Facebook - http://fb.com/MariaDB.dbms Knowledgebase - http://kb.askmonty.org
hum, lets think about 10 years, maybe less what happen after 2^64 value of the last digit on gtid? 1-1-2^64 it will go back to 0? 2013/5/7 Daniel Bartholomew <dbart@mariadb.org>
On Mon, 06 May 2013 15:55:17 +0200 Kristian Nielsen <knielsen@knielsen-hq.org> wrote:
Kristian> Daniel, do you think you can get these formatted properly and Kristian> included in some appropriate place in the Knowledgebase? And Kristian> feel free to fix any problems you find in the text on the Kristian> way, of course.
Thanks to Ian Gilfillan (aka greenman), this is now in the Knowledgebase: https://kb.askmonty.org/en/global-transaction-id/
He was making some updates in the replication section of the KB and offered to put this in while he was there.
Kristian> I will then make sure to keep this updated as the code Kristian> progresses.
Thanks!
-- Daniel Bartholomew Google+ - http://gplus.to/dbart Twitter - http://twitter.com/daniel_bart
MariaDB: An Enhanced Drop-in Replacement for MySQL Website - http://mariadb.org Twitter - http://twitter.com/mariadb Google+ - http://google.com/+mariadb Facebook - http://fb.com/MariaDB.dbms Knowledgebase - http://kb.askmonty.org
_______________________________________________ Mailing list: https://launchpad.net/~maria-developers Post to : maria-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-developers More help : https://help.launchpad.net/ListHelp
-- Roberto Spadim SPAEmpresarial
Roberto Spadim <roberto@spadim.com.br> writes:
hum, lets think about 10 years, maybe less what happen after 2^64 value of the last digit on gtid? 1-1-2^64 it will go back to 0?
It will (and things will break), but to do 2^64 transactions in 10 years, you need to do 58 billion transactions per second ... Of course, since binlog files are <name>.NNNNNN, and limited to 1GB per file, you will reach the limit of max. 10^15 bytes worth of binlog much sooner ... - Kristian.
ok it's a very big number :) no problem at all in other words if we get 2^64 maybe we will change to 2^128 this could be put in manual just as an information of why use 64bits on gtid, it is interesting 2013/5/7 Kristian Nielsen <knielsen@knielsen-hq.org>
Roberto Spadim <roberto@spadim.com.br> writes:
hum, lets think about 10 years, maybe less what happen after 2^64 value of the last digit on gtid? 1-1-2^64 it will go back to 0?
It will (and things will break), but to do 2^64 transactions in 10 years, you need to do 58 billion transactions per second ...
Of course, since binlog files are <name>.NNNNNN, and limited to 1GB per file, you will reach the limit of max. 10^15 bytes worth of binlog much sooner ...
- Kristian.
-- Roberto Spadim SPAEmpresarial
Roberto Spadim <roberto@spadim.com.br> writes:
this could be put in manual just as an information of why use 64bits on gtid, it is interesting
Thanks for the suggestion, I added a note about this to the docs: https://kb.askmonty.org/en/global-transaction-id/#implementation - Kristian.
participants (9)
-
Alex Yurchenko
-
Arjen Lentz
-
Daniel Bartholomew
-
Giuseppe Maxia
-
Ian Gilfillan
-
Kristian Nielsen
-
MARK CALLAGHAN
-
Pavel Ivanov
-
Roberto Spadim