Merge lp://staging/~vlad-lesin/percona-xtrabackup/2.1-apply-archived-logs-innodb5.6 into lp://staging/percona-xtrabackup/2.1
- 2.1-apply-archived-logs-innodb5.6
- Merge into 2.1
Status: | Merged |
---|---|
Approved by: | Alexey Kopytov |
Approved revision: | no longer in the source branch. |
Merged at revision: | 675 |
Proposed branch: | lp://staging/~vlad-lesin/percona-xtrabackup/2.1-apply-archived-logs-innodb5.6 |
Merge into: | lp://staging/percona-xtrabackup/2.1 |
Diff against target: |
1525 lines (+1383/-17) 3 files modified
patches/innodb56.patch (+822/-0) src/xtrabackup.cc (+172/-17) test/t/xb_apply_archived_logs.sh (+389/-0) |
To merge this branch: | bzr merge lp://staging/~vlad-lesin/percona-xtrabackup/2.1-apply-archived-logs-innodb5.6 |
Related bugs: | |
Related blueprints: |
Log Archiving for xtrabackup: restoring
(Essential)
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alexey Kopytov (community) | Approve | ||
Laurynas Biveinis (community) | Needs Fixing | ||
Review via email:
|
Commit message
Description of the change
This is implementation of ability to apply archived logs in xtrabackup which is described here: https:/
See commit comment for more detailed description.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Laurynas Biveinis (laurynas-biveinis) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Vlad Lesin (vlad-lesin) wrote : | # |
> A merge conflict, unless spurious, that needs rebasing on the current trunk?
I have just rebased it on the current trunk.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alexey Kopytov (akopytov) wrote : | # |
Vlad,
- I don't think the XtraBackup part should pull the entire server
implement
of it should be applied to InnoDB 5.6 code base to be able to
parse and apply archived logs? As in, do we really need
fil_
changes to log_checkpoint_
- can you clarify the following change? I.e. under what
circumstances exactly can a tablespace exist when we are trying
to replay MLOG_FILE_CREATE from the archived logs?
+@@ -3325,9 +3341,13 @@
+ path = fil_make_
+ }
+
++ /* The files can already exist in the case of archived logs applying */
+ file = os_file_create(
+ innodb_
+- OS_FILE_CREATE | OS_FILE_
++ (srv_archive_
++ OS_FILE_OVERWRITE :
++ OS_FILE_CREATE) |
++ OS_FILE_
+ OS_FILE_NORMAL,
+ OS_DATA_FILE,
+ &ret);
- s/alligned to the up of log file block/aligned up to the log block size/
- please clarify why the following change is needed. As I
understand, we don't start the FTS optimize thread in
XtraBackup. That code is also missing block braces and is using
spaces instead of tabs for indentation:
+@@ -3032,7 +3032,8 @@
+
+ ib_logf(
+
+- os_event_
++ if (exit_event)
++ os_event_
+
+ /* We count the number of threads in os_thread_exit(). A created
+ thread should always use that to exit and not use return() to exit. */
+
- please use LSN_PF instead of "%llu"
- in recv_recovery_
argument and use xtrabackup_
it be better to pass xtrabackup_
first_log_no argument to recv_recovery_
get rid of min/max_arch_log_no in
innobase_
- in xb_data_
declarations with min/max_
used. but then the call still calls open_or_
with the (now non-existing) flushed_lsn variables?
- s/xtrabackup: Note: opening archived log directory %s was
failed/
- replace the strstr() call in xtrabackup_
strncmp()
- xtrabackup_
returns xtrabackup_
- we tend to use the InnoDB code style in xtrabackup.cc. In
particular, the opening brace must be on the same line as the
'if' statement. And braces should be used even for
single-
- s/trunsactions/
- s/undid/rolled back/
- the check for Percona Server 5.6 doesn't work (try starting it
with an upstream 5.6 server). The reason is that the syntax for
string equality comparison is "val1 = val2", not "val1=val2"
- the test case doesn't wo...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Sergei Glushchenko (sergei.glushchenko) wrote : | # |
Vlad,
Why don't we use --log-arch-dir option (with same name as server one) instead of --archived-
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Vlad Lesin (vlad-lesin) wrote : | # |
On 05/06/2013 06:21 PM, Sergei Glushchenko wrote:
> Vlad,
>
> Why don't we use --log-arch-dir option (with same name as server one) instead of --archived-
>
This is good idea, thanks.
--
Vlad Lesin, Software Engineer, Percona Inc.
<email address hidden>
skype: vlad_lesin
JID: <email address hidden>
ICQ: 204036003
phone: +79051122311
Tula, Russia (GMT +4)
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Vlad Lesin (vlad-lesin) wrote : | # |
On 05/01/2013 02:40 PM, Alexey Kopytov wrote:
> - I don't think the XtraBackup part should pull the entire server
> implementation of log archiving. It looks like only a minor part
> of it should be applied to InnoDB 5.6 code base to be able to
> parse and apply archived logs? As in, do we really need
> fil_space_
> changes to log_checkpoint_
Done.
> - can you clarify the following change? I.e. under what
> circumstances exactly can a tablespace exist when we are trying
> to replay MLOG_FILE_CREATE from the archived logs?
Yes. It can be for example in the case when this file did not exist at
the beginning of backup process and was created somewhere in the middle
of backup process. So log file contains "create" command as backup
process started tracking it before the file creation, but data directory
contains this file as it was copied from original directory. I copied
this explanation to code comment.
> +@@ -3325,9 +3341,13 @@
> + path = fil_make_
> + }
> +
> ++ /* The files can already exist in the case of archived logs applying */
> + file = os_file_create(
> + innodb_
> +- OS_FILE_CREATE | OS_FILE_
> ++ (srv_archive_
> ++ OS_FILE_OVERWRITE :
> ++ OS_FILE_CREATE) |
> ++ OS_FILE_
> + OS_FILE_NORMAL,
> + OS_DATA_FILE,
> + &ret);
>
> - s/alligned to the up of log file block/aligned up to the log block size/
Done.
> - please clarify why the following change is needed. As I
> understand, we don't start the FTS optimize thread in
> XtraBackup. That code is also missing block braces and is using
> spaces instead of tabs for indentation:
>
> +@@ -3032,7 +3032,8 @@
> +
> + ib_logf(
> +
> +- os_event_
> ++ if (exit_event)
> ++ os_event_
> +
> + /* We count the number of threads in os_thread_exit(). A created
> + thread should always use that to exit and not use return() to exit. */
> +
I fixed using spaces instead tabs for indentation and missing braces.
As I understuud FTS optimize thread is started in xtrabackup because I
have the following backtrace in the case of missing exit_event condition:
56 ../nptl/
(gdb) bt
#0 0x00007ffff633f037 in __GI_raise (sig=sig@entry=6) at
../nptl/
#1 0x00007ffff6342698 in __GI_abort () at abort.c:90
#2 0x000000000063ac80 in os_event_set (event=0x0)
at
/home/vlesin/
#3 0x00000000006063ec in fts_optimize_thread (arg=0x1e604e8)
at
/home/vlesin/
#4 0x00007ffff79bcf8e in start_thread (arg=0x7fffd57f
pthread_
#5 0x00007ffff6401e1d in clone () at
../sysdeps/
Here is the backtrace of FTS initializati...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Vlad Lesin (vlad-lesin) wrote : | # |
On 05/06/2013 06:21 PM, Sergei Glushchenko wrote:
> Vlad,
>
> Why don't we use --log-arch-dir option (with same name as server one) instead of --archived-
>
Done.
--
Vlad Lesin, Software Engineer, Percona Inc.
<email address hidden>
skype: vlad_lesin
JID: <email address hidden>
ICQ: 204036003
phone: +79051122311
Tula, Russia (GMT +4)
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alexey Kopytov (akopytov) wrote : | # |
Hi Vlad,
General comments:
- I think this MP should wait until 5.6.11-60.3 with the fix for bug
#1172591 is released. Then the test suite should use 5.6.11-60.30
for testing instead of the custom build
- there should be a separate fix for bug #1177182 for both 2.0 and
2.1, and again, this branch should be rebased once the fix is merged to
trunks.
- xtrabackup_
Other comments/questions:
On Fri, 10 May 2013 09:42:06 +0400, Vlad Lesin wrote:
>> - can you clarify the following change? I.e. under what
>> circumstances exactly can a tablespace exist when we are trying
>> to replay MLOG_FILE_CREATE from the archived logs?
>
> Yes. It can be for example in the case when this file did not exist at
> the beginning of backup process and was created somewhere in the middle
> of backup process. So log file contains "create" command as backup
> process started tracking it before the file creation, but data directory
> contains this file as it was copied from original directory. I copied
> this explanation to code comment.
>
If a tablespace exists on recovery, it is created into fil_system before
the recovery starts. When replaying MLOG_FILE_CREATE,
fil_op_
fil_system and does nothing. So I still don't understand that change in
fil_create_
>
>> +@@ -3325,9 +3341,13 @@
>> + path = fil_make_
>> + }
>> +
>> ++ /* The files can already exist in the case of archived logs
>> applying */
>> + file = os_file_create(
>> + innodb_
>> +- OS_FILE_CREATE | OS_FILE_
>> ++ (srv_archive_
>> ++ OS_FILE_OVERWRITE :
>> ++ OS_FILE_CREATE) |
>> ++ OS_FILE_
>> + OS_FILE_NORMAL,
>> + OS_DATA_FILE,
>> + &ret);
>>
>> - s/alligned to the up of log file block/aligned up to the log
>> block size/
>
> Done.
>
Not fully done, it is "aligned" (single "l"), not "alligned".
>> - please clarify why the following change is needed. As I
>> understand, we don't start the FTS optimize thread in
>> XtraBackup. That code is also missing block braces and is using
>> spaces instead of tabs for indentation:
>>
>> +@@ -3032,7 +3032,8 @@
>> +
>> + ib_logf(
>> +
>> +- os_event_
>> ++ if (exit_event)
>> ++ os_event_
>> +
>> + /* We count the number of threads in os_thread_exit(). A created
>> + thread should always use that to exit and not use return() to
>> exit. */
>> +
>
> I fixed using spaces instead tabs for indentation and missing braces.
>
> As I understuud FTS optimize thread is started in xtrabackup because I
>
OK, I see the problem now, reported as bug #1179193. This means we have
to fix that bug separately in both 2.0 and 2.1, and then rebase this
branch on 2.1 trunk with that fix included.
>> - please use LSN_PF instead of "%llu"
>
...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Vlad Lesin (vlad-lesin) wrote : | # |
On 05/12/2013 04:48 PM, Alexey Kopytov wrote:
>>> - in recv_recovery_
>>> argument and use xtrabackup_
>>> it be better to pass xtrabackup_
>>> first_log_no argument to recv_recovery_
As I understood our chat right the main cause of this change is to
remove 'fake' arguments from recv_recovery_
Why just don't remove first_log_no from
recv_recovery_
benefits in passing xtrabackup_
xtrabackup_
arguments because in this case we just remove using global external
variables from recv_recovery_
innobase_
>>> get rid of min/max_arch_log_no in
>>> innobase_
Right. In this case we could remove min/max_arch_log_no from
open_or_
too.
--
Vlad Lesin, Software Engineer, Percona Inc.
<email address hidden>
skype: vlad_lesin
JID: <email address hidden>
ICQ: 204036003
phone: +79051122311
Tula, Russia (GMT +4)
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Vlad Lesin (vlad-lesin) wrote : | # |
On 05/12/2013 04:48 PM, Alexey Kopytov wrote:
>
> I tried to repeat the test, but your branch doesn't build for me now, it
> fails as follows:
>
> [ 70%] Building CXX object
> libmysqld/
> /Users/
> error: no matching function for call to
> 'log_checkpoint
> log_checkpoint_
> ^~~~~~~
> /Users/
> note: candidate function not viable: no known
> conversion from 'lsn_t *' (aka 'unsigned long long *') to 'ulint
> *' (aka 'unsigned long *') for 3rd argument;
> log_checkpoint_
> ^
> 1[ 70%] error generated.
>
I am preparing the more detailed answer with code fixes so currently I
don't want to commit unfinished changes. But it is possible just to
comment log_checkpoint_
because the values it reads from buffer are not used for logs applying.
--
Vlad Lesin, Software Engineer, Percona Inc.
<email address hidden>
skype: vlad_lesin
JID: <email address hidden>
ICQ: 204036003
phone: +79051122311
Tula, Russia (GMT +4)
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alexey Kopytov (akopytov) wrote : | # |
Hi Vlad,
On Mon, 13 May 2013 17:44:36 +0400, Vlad Lesin wrote:
> On 05/12/2013 04:48 PM, Alexey Kopytov wrote:
>>>> - in recv_recovery_
>>>> first_log_no
>>>> argument and use xtrabackup_
>>>> wouldn't
>>>> it be better to pass xtrabackup_
>>>> first_log_no argument to recv_recovery_
>>>> and
>
> As I understood our chat right the main cause of this change is to
> remove 'fake' arguments from recv_recovery_
>
> Why just don't remove first_log_no from
> recv_recovery_
> benefits in passing xtrabackup_
> xtrabackup_
> arguments because in this case we just remove using global external
> variables from recv_recovery_
> innobase_
>
Either way is fine by me as long as we avoid fake arguments.
> >>> get rid of min/max_arch_log_no in
> >>> innobase_
>
> Right. In this case we could remove min/max_arch_log_no from
> open_or_
> too.
>
OK.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Vlad Lesin (vlad-lesin) wrote : | # |
> > Why just don't remove first_log_no from
> > recv_recovery_
> > benefits in passing xtrabackup_
> > xtrabackup_
> > arguments because in this case we just remove using global external
> > variables from recv_recovery_
> > innobase_
> >
>
> Either way is fine by me as long as we avoid fake arguments.
Done.
> > Right. In this case we could remove min/max_arch_log_no from
> > open_or_
> > too.
> >
>
> OK.
Done.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Vlad Lesin (vlad-lesin) wrote : | # |
> Hi Vlad,
>
>
> General comments:
>
> - I think this MP should wait until 5.6.11-60.3 with the fix for bug
> #1172591 is released. Then the test suite should use 5.6.11-60.30
> for testing instead of the custom build
The fix is released.
> - there should be a separate fix for bug #1177182 for both 2.0 and
> 2.1, and again, this branch should be rebased once the fix is merged to
> trunks.
The fix for 2.1 is merged and for 2.0 is approved for merging.
> - xtrabackup_
> fprintf(stderr,...)
Fixed.
> >> - s/alligned to the up of log file block/aligned up to the log
> >> block size/
> >
> > Done.
> >
>
> Not fully done, it is "aligned" (single "l"), not "alligned".
Done.
> OK, I see the problem now, reported as bug #1179193. This means we have
> to fix that bug separately in both 2.0 and 2.1, and then rebase this
> branch on 2.1 trunk with that fix included.
I explored this problem more deeply and found out that the problem is "apply archived log" specific. See my comment to the bug report and
if (srv_apply_
}
strings in innobase_
> >> - the test case doesn't work for me (fails with "table 'test.t1'
> >> doesn't exist" when run against PS 5.6 with log archiving enabled)
> >>
> >
> > I need your assistance here because I can't reproduce this on my
> > environment and, as I understood, on Jenkins environment too(see
> > http://
> xtrabackup-
> >
>
> I tried to repeat the test, but your branch doesn't build for me now, it
> fails as follows:
>
> [ 70%] Building CXX object
> libmysqld/
> /Users/
> innodb5.
> error: no matching function for call to
> 'log_checkpoint
> log_checkpoint_
> ^~~~~~~
> /Users/
> innodb5.
> note: candidate function not viable: no known
> conversion from 'lsn_t *' (aka 'unsigned long long *') to 'ulint
> *' (aka 'unsigned long *') for 3rd argument;
> log_checkpoint_
> ^
> 1[ 70%] error generated.
Fixed. The invocation of log_checkpoint_
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Vlad Lesin (vlad-lesin) wrote : | # |
Rebased on newest trunk (lp:percona-xtrabackup revision 650).
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alexey Kopytov (akopytov) wrote : | # |
I don't think XtraDB-related changes in run.sh are necessary now. Check the is_xtradb(
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alexey Kopytov (akopytov) wrote : | # |
Oh, and you will also need require_
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Vlad Lesin (vlad-lesin) wrote : | # |
On 07/31/2013 04:54 PM, Alexey Kopytov wrote:
> I don't think XtraDB-related changes in run.sh are necessary now. Check the is_xtradb(
>
Yes, you are right, there is no need to change run.sh as server and
innodb flavours are detected right now based on "innodb_version" server
variable.
But require_
require_
require_
need to check server flavour too as well as
require_
but xtradb version must be checked too.
So I reverted run.sh and fixed xb_apply_
is_server_
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alexey Kopytov (akopytov) wrote : | # |
Hi Vlad,
On Wed, 31 Jul 2013 21:43:33 -0000, Vlad Lesin wrote:
> But require_
> require_
> require_
> need to check server flavour too as well as
> require_
> but xtradb version must be checked too.
>
You can do:
require_xtradb
require_
Or use is_* functions if you need something complex.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Vlad Lesin (vlad-lesin) wrote : | # |
On 08/01/2013 08:39 AM, Alexey Kopytov wrote:
> Hi Vlad,
>
> On Wed, 31 Jul 2013 21:43:33 -0000, Vlad Lesin wrote:
>> But require_
>> require_
>> require_
>> need to check server flavour too as well as
>> require_
>> but xtradb version must be checked too.
>>
>
> You can do:
>
> require_xtradb
> require_
>
> Or use is_* functions if you need something complex.
>
Yes, but xtradb can be 5.5,5.1 or 5.6. But only 5.6 supports logs applying.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alexey Kopytov (akopytov) wrote : | # |
Hi Vlad,
On Thu, 01 Aug 2013 11:01:56 +0400, Vlad Lesin wrote:
>> You can do:
>>
>> require_xtradb
>> require_
>>
>> Or use is_* functions if you need something complex.
>>
>
> Yes, but xtradb can be 5.5,5.1 or 5.6. But only 5.6 supports logs applying.
>
The above 2 lines will make the test run only on XtraDB > 5.6.10?
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Vlad Lesin (vlad-lesin) wrote : | # |
http://
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alexey Kopytov (akopytov) wrote : | # |
Vlad,
Do you have any explanations for multiple test failures and crashes in both builds?
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Vlad Lesin (vlad-lesin) wrote : | # |
> Vlad,
>
> Do you have any explanations for multiple test failures and crashes in both
> builds?
Yes, there were bug concerned with wrong lsn writing to data files on "prepare" step when logs applying is not used. I fixed it, here is the new test results:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alexey Kopytov (akopytov) wrote : | # |
Vlad,
Approved, but please rebase on the current trunk. I get many conflicts in innodb56.patch. The good news is that it's going to be the last rebase for this branch. Sorry about the stretched review process. Please also do another Jenkins param build after rebasing.
Thanks.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Vlad Lesin (vlad-lesin) wrote : | # |
> Vlad,
>
> Approved, but please rebase on the current trunk. I get many conflicts in
> innodb56.patch. The good news is that it's going to be the last rebase for
> this branch. Sorry about the stretched review process. Please also do another
> Jenkins param build after rebasing.
>
> Thanks.
Done.
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alexey Kopytov (akopytov) : | # |
A merge conflict, unless spurious, that needs rebasing on the current trunk?