MariaDB GTID current_pos vs slave_pos
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
In a standard master-slave setup using MariaDB (10.3 at this time) and GTID (Global Transaction ID), it is unclear wether to use current_pos or slave_pos.
Reminder from the documentation:
- Using the value current_pos causes the slave to set its position based on the gtid_current_pos system variable. The slave takes the position given to it by the master server.
- Using the value slave_pos causes the slave to instead use the gtid_slave_pos system variable. With this method, the slave takes into account transactions present in its own Binary Log.
I think I understand the difference but what is the recommended option?
To the extent that both exist, one might be better for one use case and the other for another use case but the documentation does not clearly state which one should be used in which case...
Which of these options would you use for a very common case of master-slave replication?
EDIT 2019-01-18: Context
The context that led me to ask myself whether I should use current_pos or slave_pos:
I recently upgraded some MariaDB clusters (master-slave setups) from MariaDB 10.1 or 10.2 to MariaDB 10.3 on Debian Stretch, using APT.
In practice, I always proceed like this:
- Upgrade slave(s) to 10.3 (using an apt dist-upgrade)
- Run mysql_upgrade
- Switchover master (using Signal18 Replication-manager)
- Upgrade the old master (that became a slave at the previous step)
- Switchover master again to return to the original configuration
However, during recent updates, I encountered some failures at Slave Start after running a mysql_upgrade command. It did not found binlogs using GTID current position.
This happens, I believe, when there has be No transaction on the master since the last master switchover. In this case, switching GTID mode from current_pos to slave_pos fix the problem...
Then, should I definitely use slave_pos? However, even in this case, Replication-Manager forces GTID mode to current_pos after a switchover...
replication mariadb gtid
add a comment |
In a standard master-slave setup using MariaDB (10.3 at this time) and GTID (Global Transaction ID), it is unclear wether to use current_pos or slave_pos.
Reminder from the documentation:
- Using the value current_pos causes the slave to set its position based on the gtid_current_pos system variable. The slave takes the position given to it by the master server.
- Using the value slave_pos causes the slave to instead use the gtid_slave_pos system variable. With this method, the slave takes into account transactions present in its own Binary Log.
I think I understand the difference but what is the recommended option?
To the extent that both exist, one might be better for one use case and the other for another use case but the documentation does not clearly state which one should be used in which case...
Which of these options would you use for a very common case of master-slave replication?
EDIT 2019-01-18: Context
The context that led me to ask myself whether I should use current_pos or slave_pos:
I recently upgraded some MariaDB clusters (master-slave setups) from MariaDB 10.1 or 10.2 to MariaDB 10.3 on Debian Stretch, using APT.
In practice, I always proceed like this:
- Upgrade slave(s) to 10.3 (using an apt dist-upgrade)
- Run mysql_upgrade
- Switchover master (using Signal18 Replication-manager)
- Upgrade the old master (that became a slave at the previous step)
- Switchover master again to return to the original configuration
However, during recent updates, I encountered some failures at Slave Start after running a mysql_upgrade command. It did not found binlogs using GTID current position.
This happens, I believe, when there has be No transaction on the master since the last master switchover. In this case, switching GTID mode from current_pos to slave_pos fix the problem...
Then, should I definitely use slave_pos? However, even in this case, Replication-Manager forces GTID mode to current_pos after a switchover...
replication mariadb gtid
1
What is the context of deciding between these?
– Rick James
Jan 14 at 17:25
add a comment |
In a standard master-slave setup using MariaDB (10.3 at this time) and GTID (Global Transaction ID), it is unclear wether to use current_pos or slave_pos.
Reminder from the documentation:
- Using the value current_pos causes the slave to set its position based on the gtid_current_pos system variable. The slave takes the position given to it by the master server.
- Using the value slave_pos causes the slave to instead use the gtid_slave_pos system variable. With this method, the slave takes into account transactions present in its own Binary Log.
I think I understand the difference but what is the recommended option?
To the extent that both exist, one might be better for one use case and the other for another use case but the documentation does not clearly state which one should be used in which case...
Which of these options would you use for a very common case of master-slave replication?
EDIT 2019-01-18: Context
The context that led me to ask myself whether I should use current_pos or slave_pos:
I recently upgraded some MariaDB clusters (master-slave setups) from MariaDB 10.1 or 10.2 to MariaDB 10.3 on Debian Stretch, using APT.
In practice, I always proceed like this:
- Upgrade slave(s) to 10.3 (using an apt dist-upgrade)
- Run mysql_upgrade
- Switchover master (using Signal18 Replication-manager)
- Upgrade the old master (that became a slave at the previous step)
- Switchover master again to return to the original configuration
However, during recent updates, I encountered some failures at Slave Start after running a mysql_upgrade command. It did not found binlogs using GTID current position.
This happens, I believe, when there has be No transaction on the master since the last master switchover. In this case, switching GTID mode from current_pos to slave_pos fix the problem...
Then, should I definitely use slave_pos? However, even in this case, Replication-Manager forces GTID mode to current_pos after a switchover...
replication mariadb gtid
In a standard master-slave setup using MariaDB (10.3 at this time) and GTID (Global Transaction ID), it is unclear wether to use current_pos or slave_pos.
Reminder from the documentation:
- Using the value current_pos causes the slave to set its position based on the gtid_current_pos system variable. The slave takes the position given to it by the master server.
- Using the value slave_pos causes the slave to instead use the gtid_slave_pos system variable. With this method, the slave takes into account transactions present in its own Binary Log.
I think I understand the difference but what is the recommended option?
To the extent that both exist, one might be better for one use case and the other for another use case but the documentation does not clearly state which one should be used in which case...
Which of these options would you use for a very common case of master-slave replication?
EDIT 2019-01-18: Context
The context that led me to ask myself whether I should use current_pos or slave_pos:
I recently upgraded some MariaDB clusters (master-slave setups) from MariaDB 10.1 or 10.2 to MariaDB 10.3 on Debian Stretch, using APT.
In practice, I always proceed like this:
- Upgrade slave(s) to 10.3 (using an apt dist-upgrade)
- Run mysql_upgrade
- Switchover master (using Signal18 Replication-manager)
- Upgrade the old master (that became a slave at the previous step)
- Switchover master again to return to the original configuration
However, during recent updates, I encountered some failures at Slave Start after running a mysql_upgrade command. It did not found binlogs using GTID current position.
This happens, I believe, when there has be No transaction on the master since the last master switchover. In this case, switching GTID mode from current_pos to slave_pos fix the problem...
Then, should I definitely use slave_pos? However, even in this case, Replication-Manager forces GTID mode to current_pos after a switchover...
replication mariadb gtid
replication mariadb gtid
edited Jan 18 at 16:06
Nicolas Payart
asked Jan 14 at 10:52
Nicolas PayartNicolas Payart
80031228
80031228
1
What is the context of deciding between these?
– Rick James
Jan 14 at 17:25
add a comment |
1
What is the context of deciding between these?
– Rick James
Jan 14 at 17:25
1
1
What is the context of deciding between these?
– Rick James
Jan 14 at 17:25
What is the context of deciding between these?
– Rick James
Jan 14 at 17:25
add a comment |
1 Answer
1
active
oldest
votes
Use current_pos to switchover master.
Use slave_pos for a regular replication
current_pos - last change in GTID domain
slave_pos - last replicated change applied by SQL thread or parallel workers on the replica.
So, imagine your ordinary replica (node2) switched to a master. slave_pos not incrementing, because changes are applied directly without any replication. Then you need to reconfigure cluster and make the new master become replica again.
What you will see on node2
SHOW global variables like '%pos%'?
you will see, that
slave_pos stopped incrementing on the moment of switchover
current_pos incrementing correctly
In order node2 to become replica you must use current_pos, after the workload switched to a new master.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "182"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f227078%2fmariadb-gtid-current-pos-vs-slave-pos%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Use current_pos to switchover master.
Use slave_pos for a regular replication
current_pos - last change in GTID domain
slave_pos - last replicated change applied by SQL thread or parallel workers on the replica.
So, imagine your ordinary replica (node2) switched to a master. slave_pos not incrementing, because changes are applied directly without any replication. Then you need to reconfigure cluster and make the new master become replica again.
What you will see on node2
SHOW global variables like '%pos%'?
you will see, that
slave_pos stopped incrementing on the moment of switchover
current_pos incrementing correctly
In order node2 to become replica you must use current_pos, after the workload switched to a new master.
add a comment |
Use current_pos to switchover master.
Use slave_pos for a regular replication
current_pos - last change in GTID domain
slave_pos - last replicated change applied by SQL thread or parallel workers on the replica.
So, imagine your ordinary replica (node2) switched to a master. slave_pos not incrementing, because changes are applied directly without any replication. Then you need to reconfigure cluster and make the new master become replica again.
What you will see on node2
SHOW global variables like '%pos%'?
you will see, that
slave_pos stopped incrementing on the moment of switchover
current_pos incrementing correctly
In order node2 to become replica you must use current_pos, after the workload switched to a new master.
add a comment |
Use current_pos to switchover master.
Use slave_pos for a regular replication
current_pos - last change in GTID domain
slave_pos - last replicated change applied by SQL thread or parallel workers on the replica.
So, imagine your ordinary replica (node2) switched to a master. slave_pos not incrementing, because changes are applied directly without any replication. Then you need to reconfigure cluster and make the new master become replica again.
What you will see on node2
SHOW global variables like '%pos%'?
you will see, that
slave_pos stopped incrementing on the moment of switchover
current_pos incrementing correctly
In order node2 to become replica you must use current_pos, after the workload switched to a new master.
Use current_pos to switchover master.
Use slave_pos for a regular replication
current_pos - last change in GTID domain
slave_pos - last replicated change applied by SQL thread or parallel workers on the replica.
So, imagine your ordinary replica (node2) switched to a master. slave_pos not incrementing, because changes are applied directly without any replication. Then you need to reconfigure cluster and make the new master become replica again.
What you will see on node2
SHOW global variables like '%pos%'?
you will see, that
slave_pos stopped incrementing on the moment of switchover
current_pos incrementing correctly
In order node2 to become replica you must use current_pos, after the workload switched to a new master.
answered 28 mins ago
Ilshat KarazbayevIlshat Karazbayev
662
662
add a comment |
add a comment |
Thanks for contributing an answer to Database Administrators Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f227078%2fmariadb-gtid-current-pos-vs-slave-pos%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
What is the context of deciding between these?
– Rick James
Jan 14 at 17:25