Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the details of Percona xtrabackup backup

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

Today, I will talk to you about the details of Percona xtrabackup. Many people may not know much about it. In order to let you know more, Xiaobian summarized the following contents for you. I hope you can gain something according to this article.

xtrabackup does two main things to complete the backup:

Mission 1:

xtrabackup will start a log-copying thread in the background, which will monitor the redo log file and continuously copy the data blocks (log records) added from lsn1 (lsn1 is the log sequence number corresponding to the last checkpoint Xtrabackup will obtain from redo log file at startup) to a file called xtrabackup_logfile in the backup set. Log copy operation will be carried out throughout the backup process, because when the backup set is restored, all log records from lsn1 to the end of backup are required. The recovery principle is the process of crash recovery.

Note:

The log-copying thread checks the transaction log every second to see if there are any newly written log entries that need to be copied. But there's a possibility:

Log-copying threads copy slower than write redofile, it is possible that the transaction log cycle a week, resulting in a partial log

The log-copying thread will report an error and the backup will fail.

Mission 2:

xtrabackup copies innodb's data file while copying redo logs. Of course, this is not a simple copy. It accesses the data file in a similar way to innodb, accesses the data dictionary, and copies the data page by page. Details are as follows:

Xtrabackup opens a data file read-write, although it does not modify the data. This is because it uses the built-in innodb lib library

To access the data file, it also implies that you want to use a user who has read and write access to the data file to make a backup. innodb lib library is typed using read-write mode

Open because normally opening a file indicates writing data.

xtrabackup reads 1M of data each time it copies log files (not configurable) during the process of copying data to the backup destination directory

Each read and write 512 bytes, also can not be configured. After the data is read, xtrabackup scans the 1M cache blocks and scans each one.

The data page is verified using the buf_page_is_corrupted() function to see if it is corrupted. If the page is corrupted, it is re-read and re-read.

Verification. If rereading fails 10 times and the backup fails, the backup fails.

(It skips this check on the doublewrite buffer)

xtraback backup end

When the data file copy is complete, xtrabackup stops the log-copying thread and creates a new file in the backup directory.

xtrabackup_checkpoints file, which contains the backup type, log sequence number at the start of the backup, and log sequence number at the end. During the backup process, we will see the data file copy information, and we will also see the log copy thread repeatedly scanning the log file, and the process copy information, the information is as follows:

>> log scanned up to (3646475465483)

>> log scanned up to (3646475517369)

>> log scanned up to (3646475581716)

>> log scanned up to (3646475636841)

>> log scanned up to (3646475718082)

>> log scanned up to (3646475988095)

>> log scanned up to (3646476048286)

>> log scanned up to (3646476102877)

>> log scanned up to (3646476140854)

[01] Copying /usr/local/mysql/var/ibdata1

to /usr/local/mysql/Backups/2011-04-18_21-11-15/ibdata1

[01] ... done

the log file thread repeatedly scanning the log files and copying from it

After reading the above, do you know more about the details of Percona xtrabackup? If you still want to know more knowledge or related content, please pay attention to the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report