Archive logs --prepare after --apply-logs-only gives error InnoDB: Archive log file <nr> starts from too big a lsn
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona XtraBackup moved to https://jira.percona.com/projects/PXB |
Triaged
|
Medium
|
Vlad Lesin | ||
2.1 |
Triaged
|
Medium
|
Vlad Lesin | ||
2.2 |
Triaged
|
Medium
|
Vlad Lesin | ||
2.3 |
Triaged
|
Medium
|
Vlad Lesin |
Bug Description
This may not be a supported use of archive logs and if not I think we should report something when preparing archive logs and we notice --apply-logs-only also specified and document usage accordingly _or_ maybe this is a valid use case in which there is an issue as described below:
Using XB 2.1 from ~vlad-lesin/
-------
revno: 611
committer: Vlad Lesin <email address hidden>
branch nick: percona-
timestamp: Thu 2013-07-04 13:43:59 +0400
message:
Use PS-5.6.11 for testing xtradb56 engine as PS-5.6.11 supports logs archiving.
and PS 5.6 trunk from a few weeks ago:
-------
revno: 389 [merge]
committer: Laurynas Biveinis <email address hidden>
branch nick: 5.6
timestamp: Fri 2013-06-21 12:02:58 +0300
message:
Automerge lp:~stewart/percona-server/bug1072573-5.6
So the setup with basic sysbench oltp write only load on the server:
Take a basic full backup into $PWD/backup-0.0
Wait a bit and move all but current archive logs into $PWD/backup-0.1
> ls -la $PWD/backup-0.1
-rw-rw----. 1 root root 67108864 Jul 9 22:41 ib_log_
-rw-rw----. 1 root root 67108864 Jul 9 22:42 ib_log_
-rw-rw----. 1 root root 67108864 Jul 9 22:42 ib_log_
Wait a bit more and again move all but current archive logs into $PWD/backup-0.2
> ls -la $PWD/backup-0.2
-rw-r-----. 1 root root 67108864 Jul 9 22:52 ib_log_
> cp -r $PWD/backup-0.0 $PWD/restore-base
> cp -r $PWD/backup-0.1 $PWD/restore-logs-0
> cp -r $PWD/backup-0.2 $PWD/restore-logs-1
Run first prepare:
> ( PATH=/mnt/
xtrabackup version 2.1.3 for MySQL server 5.6.10 Linux (x86_64) (revision id: undefined)
xtrabackup: cd to /mnt/test/
xtrabackup: Temporary instance for recovery is set as followings.
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
InnoDB: Allocated tablespace 2, old maximum was 0
xtrabackup: Temporary instance for recovery is set as followings.
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: Starting InnoDB instance for recovery.
xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Compressed tables use zlib 1.2.3
InnoDB: CPU does not support crc32 instructions
InnoDB: Initializing buffer pool, size = 100.0M
InnoDB: Completed initialization of buffer pool
InnoDB: Setting log file ./ib_logfile101 size to 64 MB
InnoDB: Setting log file ./ib_logfile1 size to 64 MB
InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
InnoDB: New log files created, LSN=44859916
InnoDB: Starting archive recovery from a backup...
InnoDB: Allocated tablespace 2, old maximum was 0
InnoDB: Opened archived log file /mnt/test/
InnoDB: Opened archived log file /mnt/test/
InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percent: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percent: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percent: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
InnoDB: 2 transaction(s) which must be rolled back or cleaned up
InnoDB: in total 19 row operations to undo
InnoDB: Trx id counter is 63744
[notice (again)]
If you use binary log and don't use any hack of group commit,
the binary log position seems to be:
xtrabackup: starting shutdown with innodb_
InnoDB: Starting shutdown...
InnoDB: Shutdown completed; log sequence number 134259030
Now run the next prepare:
> ( PATH=/mnt/
xtrabackup version 2.1.3 for MySQL server 5.6.10 Linux (x86_64) (revision id: undefined)
xtrabackup: cd to /mnt/test/
xtrabackup: Temporary instance for recovery is set as followings.
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
InnoDB: Allocated tablespace 2, old maximum was 0
xtrabackup: Temporary instance for recovery is set as followings.
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: Starting InnoDB instance for recovery.
xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Compressed tables use zlib 1.2.3
InnoDB: CPU does not support crc32 instructions
InnoDB: Initializing buffer pool, size = 100.0M
InnoDB: Completed initialization of buffer pool
InnoDB: Starting archive recovery from a backup...
InnoDB: Allocated tablespace 2, old maximum was 0
InnoDB: Opened archived log file /mnt/test/
InnoDB: Archive log file /mnt/test/
InnoDB: 2 transaction(s) which must be rolled back or cleaned up
InnoDB: in total 19 row operations to undo
InnoDB: Trx id counter is 63744
[notice (again)]
If you use binary log and don't use any hack of group commit,
the binary log position seems to be:
xtrabackup: starting shutdown with innodb_
InnoDB: Starting shutdown...
InnoDB: Shutdown completed; log sequence number 134259030
Changed in percona-xtrabackup: | |
assignee: | nobody → Vlad Lesin (vlad-lesin) |
milestone: | none → 2.1.4 |
importance: | Undecided → High |
--apply-logs-only is mandatory for archived logs applying because it is assumed that unfinished transactions can be finished during the further logs applying. Even if this option is not set by user explicitly it is set in xtrabackup.cc implicitly:
/*
Unfinished transactions are not rolled back during log applying
as they can be finished at the firther files applyings.
srv_apply_ log_only = TRUE;
*/
The bug is reproduced without --apply-logs-only too.