[MDEV-31687] Mariabackup Incremental backup does not advance LSN Created: 2023-07-14 Updated: 2023-09-19 Resolved: 2023-08-21 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | mariabackup |
| Affects Version/s: | 10.5, 10.6, 10.9, 10.10, 10.11, 11.0, 11.1 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Edward Stoever | Assignee: | Marko Mäkelä |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
You will see that xtrabackup_checkpoints will look like this:
Which means it does not backup changes since previous full backup. |
| Comments |
| Comment by Elena Stepanova [ 2023-07-16 ] | ||||||||||||||||||||||||||||||||
|
edward, thanks for the report with a reproducer.
Did you observe an actual data loss, or is it a conclusion based on the numbers? I can reproduce the effect as described, but I'm not sure whether it is a problem in itself. At least in my case the inserted data was still there after restoring from the backup. For the LSNs, according to the file name, it is supposed to contain checkpoints, and that's what it does.
It is so in all of 10.5+. In 10.4, the checkpoint does change, and again, it corresponds the one in innodb status:
I'll leave it to InnoDB people to decide what needs to be done here, if anything. | ||||||||||||||||||||||||||||||||
| Comment by Edward Stoever [ 2023-07-17 ] | ||||||||||||||||||||||||||||||||
|
Hello elenst | ||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-08-03 ] | ||||||||||||||||||||||||||||||||
|
As far as I can tell, in the file xtrabackup_checkpoints (or mariadb_backup_checkpoints in some later versions) there are three numbers. In the data directory that I just uploaded to
Without looking at the code, I would assume the following:
In the case of the If you execute an incremental backup in a rather quick succession, it is possible that the server will not execute any checkpoints in between. Please check MDEV-30000. Would this claimed issue be resolved if you tell InnoDB to execute a log checkpoint before executing each incremental backup?
| ||||||||||||||||||||||||||||||||
| Comment by Edward Stoever [ 2023-08-20 ] | ||||||||||||||||||||||||||||||||
|
Thank you to elenst and marko for helping with this issue. You have led to a better understanding of the mechanics of the innodb redo log and its effect on mariabackup incremental backup. If the redo log is not yet flushed, the new blocks added by running thousand_rows.sql (or any changed blocks) are saved in redo until the thread that flushes them starts. This will not happen for a while with the default configuration of MariaDB. You can see it with the attached query Query_for_redo_occupancy.sql. Sample output here:
The default is 90% occupancy to start the flushing, and I had not yet reached that point. This is valuable and helpful! | ||||||||||||||||||||||||||||||||
| Comment by Edward Stoever [ 2023-08-20 ] | ||||||||||||||||||||||||||||||||
|
Final note, if you add in the command to start the process that flushes redo, you get the expected result proving that the incremental includes new blocks:
And, review the xtrabackup_checkpoints from the incremental backup:
After a restore that includes the incremental, I see 100,000 rows on the table thousand_rows and the table bktiming is:
| ||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-08-21 ] | ||||||||||||||||||||||||||||||||
|
I’m closing this as “not a bug”. In MDEV-14992, we might want to support a special form of incremental backup that will only read and copy the log, if the log checkpoint LSN has not been advanced beyond the end LSN of the previously finished incremental backup. |