[DOC] Innobackupex point-in-time-recovery log start-pos explanation improvement
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona XtraBackup moved to https://jira.percona.com/projects/PXB |
Invalid
|
Undecided
|
Unassigned |
Bug Description
[In:Percona XtraBackup Documentation]
URL https:/
The documentation states that the exact position of the backup is contained in the file xtrabackup_
$ cat /path/to/
mysql-bin.000003 57
Later it states that "[...] the next step is extracting the queries from the binary log with mysqlbinlog starting from the position of the snapshot" by running the command
$ mysqlbinlog binlogs... --start-position=57 > mybinlog.sql
But this would replay again the transaction #57, that is the transaction that the backup is from.
Wouldn't start-position need to be the backup position + 1 (in this case 58) ?
Hi,
Start position is not needed to set backup position +1. Because, when you take a backup, in xtrabackup_ binlog_ info file, next position will be saved. i.e see here,
Before backup, the last position of binlog file was 1096,
root@desktop: /var/lib/ mysql# mysqlbinlog mysql-bin.000001 PSEUDO_ SLAVE_MODE= 1*/; max_insert_ delayed_ threads= 0*/; _TYPE=@ @COMPLETION_ TYPE,COMPLETION _TYPE=0* /; TYPE=@OLD_ COMPLETION_ TYPE*/; PSEUDO_ SLAVE_MODE= 0*/; /var/lib/ mysql#
/*!50530 SET @@SESSION.
/*!40019 SET @@session.
/*!50003 SET @OLD_COMPLETION
DELIMITER /*!*/;
# at 4
...
..
.
# at 1096
#150721 11:07:28 server id 1 end_log_pos 1127 CRC32 0xd70d67a0 Xid = 143
COMMIT/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_
/*!50530 SET @@SESSION.
root@desktop:
When I take a backup and check xtrabackup_ binlog_ info file, the position was 1127. This position is not in binlog file.
root@desktop: /home/nilnandan /backup/ 2015-07- 21_11-10- 53# cat xtrabackup_ binlog_ info /home/nilnandan /backup/ 2015-07- 21_11-10- 53#
mysql-bin.000001 1127
root@desktop:
to make further test, I added one record and check binlog file again,
root@desktop: /var/lib/ mysql# mysqlbinlog mysql-bin.000001 PSEUDO_ SLAVE_MODE= 1*/; max_insert_ delayed_ threads= 0*/; _TYPE=@ @COMPLETION_ TYPE,COMPLETION _TYPE=0* /; 1437459169/ *!*/; 1437459169/ *!*/; TYPE=@OLD_ COMPLETION_ TYPE*/; PSEUDO_ SLAVE_MODE= 0*/; /var/lib/ mysql#
/*!50530 SET @@SESSION.
/*!40019 SET @@session.
/*!50003 SET @OLD_COMPLETION
DELIMITER /*!*/;
# at 4
...
..
.
# at 1096
#150721 11:07:28 server id 1 end_log_pos 1127 CRC32 0xd70d67a0 Xid = 143
COMMIT/*!*/;
# at 1127
#150721 11:42:49 server id 1 end_log_pos 1206 CRC32 0x5388ac06 Query thread_id=40 exec_time=0 error_code=0
SET TIMESTAMP=
BEGIN
/*!*/;
# at 1206
#150721 11:42:49 server id 1 end_log_pos 1315 CRC32 0x8a641ac8 Query thread_id=40 exec_time=0 error_code=0
SET TIMESTAMP=
insert into nil values (6, 'joshi')
/*!*/;
# at 1315
#150721 11:42:49 server id 1 end_log_pos 1346 CRC32 0x333e85a0 Xid = 161
COMMIT/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_
/*!50530 SET @@SESSION.
root@desktop:
You can see that 1127 is nothing but Begin statement. I hope this clarified everything.