Not the answer you need?
Register and ask your own question!

Finding binlog position from GTID

friedokrafriedokra EntrantCurrent User Role Participant
I need translate a GTID to a binlog position. The GTID of importance in the Executed_Gtid_Set is 3299c76d-69fb-11e8-a7c6-42010af00c1e:1-433046016. I have found the section of the binlog that I believe contains the position I am looking for:
COMMIT/*!*/;
# at 1700234
#180724 14:17:46 server id 4228731923  end_log_pos 1700299 CRC32 0xbfdedb92     GTID    last_committed=307    sequence_number=309    rbr_only=no
SET @@SESSION.GTID_NEXT= '3299c76d-69fb-11e8-a7c6-42010af00c1e:433046016'/*!*/;
# at 1700299
#180724 14:17:46 server id 4228731923  end_log_pos 1700395 CRC32 0xe75c0f3c     Query    thread_id=102228893    exec_time=0    error_code=0
SET TIMESTAMP=1532456266/*!*/;
BEGIN
/*!*/;
# at 1700395
#180724 14:17:46 server id 4228731923  end_log_pos 1700474 CRC32 0xf971bc31     Table_map: `REMOVED`.`REMOVED` mapped to number 314
# at 1700474
#180724 14:17:46 server id 4228731923  end_log_pos 1700559 CRC32 0x4c686094     Write_rows: table id 314 flags: STMT_END_F
### INSERT INTO `REMOVED`.`REMOVED`
### SET
###   @1=2055074272258
..... REMOVED .....
###   @10=NULL
# at 1700559
#180724 14:17:46 server id 4228731923  end_log_pos 1700590 CRC32 0x96c41d88     Xid = 3927153257
COMMIT/*!*/;
# at 1700590
#180724 14:17:46 server id 4228731923  end_log_pos 1700655 CRC32 0x236996ef     GTID    last_committed=308    sequence_number=310    rbr_only=no
SET @@SESSION.GTID_NEXT= '3299c76d-69fb-11e8-a7c6-42010af00c1e:433046017'/*!*/;

If my understanding of GTID_NEXT is correct, then I believe position I am looking for is either 1700590 or 1700655. What position corresponds with the GTID position of 433046016? If this isn't the correct part of the binlog, I can provide the section before or after. (I have redacted sensitive parts with REMOVED)
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.