How should be implemented incremental backup

xtrabackup

new options

  • –incremental-basedir (for –backup) : the directory which has 'xtrabackup_checkpoint' to read LSN
  • –incremental-dir (for –prepare) : the directory which has *.delta files, xtrabackup_logfile and xtrabackup_checkpoint

<example>


(full backup)
# ./xtrabackup --backup --target-dir=/backup/base
...

(incremental backup)
# ./xtrabackup --backup --target-dir=/backup/delta --incremental-basedir=/backup/base
...



(prepare)
# ./xtrabackup --prepare --target-dir=/backup/base
...

(apply incremental backup)
# ./xtrabackup --prepare --target-dir=/backup/base --incremental-dir=/backup/delta
...


==primitive test implementation (experimental: xtrabackup only)==

  • .delta files must exist at the same directory to the target file
  • The LSN to the option must be the last checkpoint from the target backup

We cannot confirm whether the operations are correct or not… (Is the LSN checkpoint?, Are .delta files suitable?, etc…)

<example>

# ./xtrabackup --backup
./xtrabackup  Ver beta-0.4 for 5.0.75 unknown-linux-gnu (x86_64)
>> log scanned up to (0 378161500)
...
The latest check point (for incremental): '0:377883685'    <===== Use This.
>> log scanned up to (0 379294296)
Stopping log copying thread..
Transaction log of lsn (0 377883685) to (0 379294296) was copied.

(must do --prepare before the each incremental backup)
# ./xtrabackup --prepare
...

# ./xtrabackup --backup --incremental=0:377883685
incremental backup from 0:377883685 is enabled.
./xtrabackup  Ver beta-0.4 for 5.0.75 unknown-linux-gnu (x86_64)
>> log scanned up to (0 379708047)
Copying ./ibdata1
     to /home/kinoyasu/xtrabackup_work/mysql-5.0.75/innobase/xtrabackup/tmp_diff/ibdata1.delta
        ...done
...
The latest check point (for incremental): '0:379438233'      <==== can be used for the next incremental
>> log scanned up to (0 380663549)
Stopping log copying thread..
Transaction log of lsn (0 379438233) to (0 380663549) was copied.


# ./xtrabackup --prepare --incremental=0:377883685
incremental backup from 0:377883685 is enabled.
./xtrabackup  Ver beta-0.4 for 5.0.75 unknown-linux-gnu (x86_64)
xtrabackup_logfile detected: size=2097152, start_lsn=(0 379438233)
Applying ./ibdata1.delta ...
Applying ./tpcc/stock.ibd.delta ...
Applying ./tpcc/new_orders.ibd.delta ...
...


(We can do incremental backup repeatedly)
# ./xtrabackup --backup --incremental=0:379438233
....

# ./xtrabackup --prepare --incremental=0:379438233
....

Discussion

Enter your comment (wiki syntax is allowed):
RAZWS
 
percona-xtrabackup/spec/incremental.txt · Last modified: 2009/04/07 16:37 by vadim
 
Except where otherwise noted, content on this wiki is licensed under the following license:GNU Free Documentation License 1.2
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki