[MDEV-21157] --slave-info only contains gtid information of master and not binlog file and position with mariabackup Created: 2019-11-27  Updated: 2022-09-28  Resolved: 2020-11-16

Status: Closed
Project: MariaDB Server
Component/s: mariabackup
Affects Version/s: 10.3.17
Fix Version/s: N/A

Type: Bug Priority: Critical
Reporter: Nilnandan Joshi Assignee: Vladislav Lesin
Resolution: Incomplete Votes: 1
Labels: need_feedback

Issue Links:
Duplicate
duplicates MDEV-19264 Better support MariaDB GTID for Maria... Closed
Relates
relates to MDEV-29657 --slave-info should log the position ... Open

 Description   

While taking a backup of slave server with --slave-info option, it only contains gtid
information of master server but not binlog file and position.

As per the documentation,

"Mariabackup does not check if GTIDs are being used in replication. It takes a shortcut and assumes that if the gtid_slave_pos system variable is non-empty, then it writes the CHANGE MASTER command with the MASTER_USE_GTID option set to slave_pos. Otherwise, it writes the CHANGE MASTER command with the MASTER_LOG_FILE and MASTER_LOG_POS options using the master's binary log file and position. See MDEV-19264 for more information."
https://mariadb.com/kb/en/library/mariabackup-options/#-slave-info

so as per the code, if it will get value for gtid_slave_pos system variable, it will only mention gtid and not master log file and position. But actually, both details should be mentioned like
earlier. (OR xtrabackup does)



 Comments   
Comment by Vladislav Lesin [ 2020-09-07 ]

niljoshi, could you please clarify, what exactly xtrabackup_slave_info should contain from your perspective? It currently works exactly such as it is described in documentation.

Do you want xtrtabackup_slave_info to contain both "CHANGE MASTER command with the MASTER_USE_GTID option", and "CHANGE MASTER command with the MASTER_LOG_FILE and MASTER_LOG_POS options" in the case when gtid_slave_pos is not empty?

niljoshi Is this task a duplicate of MDEV-19264?

I think, the correct answer on my question is in MDEV-19264. I.e. if Using_Gtid of SHOW SLAVE STATUS equals to "no", then mariabackup must save master log file/position, and gtid_slave_pos otherwise.

So, I mark this issue as a duplicate of MDEV-19264, niljoshi, please change it if I am wrong.

Comment by Nilnandan Joshi [ 2020-09-08 ]

vlad.lesin Yes, currently it works exactly same as it is described in documentation. But I want that xtrabackup_slave_info should have CHANGE MASTER command with both GTID and MASTER_LOG_FILE/MASTER_LOG_POS information in any case. (either gtid_slave_pos is empty or not)

Also, I think MDEV-19264 is different than this bug because there, it's still asking for alternate option between GTID and LOG_FILE/LOG_POS while I think that it should have both.

Comment by Vladislav Lesin [ 2020-09-08 ]

niljoshi But your request conflicts with MDEV-19264. In MDEV-19264 it's explained that slave can use master file/position instead of gtid despite gtid_slave_pos is not empty. And also pointed out the correct way to determine if slave use gtids or not. It looks more reasonable to me.

Could you please explain for what purpose we need to backup both gtid and master log file/position?

GeoffMontee, as this request conflicts with your request, could you please share your opinion about this?

Comment by Vladislav Lesin [ 2020-09-08 ]

Geoff's feedback:

MDEV-21157 seems like an odd request to me. it looks like it is requesting for mariabackup to log a command like this?:

CHANGE MASTER TO
   MASTER_LOG_FILE=...,
   MASTER_LOG_POS=...,
   MASTER_USE_GTID=slave_pos;

but in this case, would the slave actually use the binlog file/position, or would it use GTID? it is ambiguous to specify both a binlog file/position and a GTID in a CHANGE MASTER command. it sounds to me like implementing MDEV-21157 would confuse users. for it to actually make sense, i think the binlog file/position and GTID would need to be logged as separate commands, so users could pick the one that they want:

# use the below command for binlog file/position
CHANGE MASTER TO
   MASTER_LOG_FILE=...,
   MASTER_LOG_POS=...;
# use the below command for GTID
CHANGE MASTER TO
   MASTER_USE_GTID=slave_pos;

but i don't know how useful this would be. imo, it would probably be more desirable for most users for us to implement MDEV-19264

Comment by Nilnandan Joshi [ 2020-09-09 ]

vlad.lesin For MDEV-21157, I dont want both the value in same command. As Geoff said, I want that there will be two CHANGE MASTER command as describe above. One with master logfile and position and another with gtid. So people can use whatever they want. I've raised this request because one of our customer was asking about the same and I also believe that it would be good if there will be both the values(binlog file/pos and gtid)

Comment by Vladislav Lesin [ 2020-09-09 ]

niljoshi What exactly problem the customer wanted to solve with such solution? I understand MDEV-19264 issue, because it leads to wrong gtid_slave_pos in backup if gtid_slave_pos is not empty, but slave is not in gtid mode. But I don't understand why do we need to backup both statements unconditionally. Probably the customer wanted to solve the issue which is described in MDEV-19264.

What if "Using_Gtid" column in SHOW SLAVE STATUS is "no", but gtid_slave_pos is not empty? If we implement MDEV-21157, there can be wrong gtid slave position in backup, and this gtid will not correspond to backed up binlog position.

What if some people use their own custom scripts to restore slaves, and such scripts just execute the content of xtrabackup_slave_info file. Will they execute both statements?

Could you please ask the customer, why does he need both CHANGE MASTER statements in backup? Could you please also ask him, if MDEV-19264 fix can solve his issue?

Comment by Vladislav Lesin [ 2020-09-14 ]

I have just pushed MDEV-19264. I set this task to 'Stalled' until we have feedback from the customer and reasonable explanations why do we need both 'CHANGE MASTER' statements in xtrabackup_slave_info.

Comment by Claudio Nanni [ 2022-09-28 ]

vlad.lesin "But I don't understand why do we need to backup both statements unconditionally."
Because binary logs can be used for PITR and currently mysqlbinlog does not support GTID.

Generated at Thu Feb 08 09:05:01 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.