PURGE CHANGED_PAGE_BITMAPS BEFORE purges too many bitmap files
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Percona Server moved to https://jira.percona.com/projects/PS |
Fix Released
|
Medium
|
Laurynas Biveinis | |
| 5.1 |
Fix Released
|
Medium
|
Laurynas Biveinis | |
| 5.5 |
Fix Released
|
Medium
|
Laurynas Biveinis | |
| 5.6 |
Fix Released
|
Medium
|
Laurynas Biveinis |
Bug Description
log_online_
$ ls -1 /var/lib/
ib_modified_
ib_modified_
ib_modified_
$ echo PURGE CHANGED_
$ ls -1 /var/lib/
/var/lib/
Instead, XtraDB should consider the start LSN of the subsequent bitmap to infer the end LSN of the current bitmap. With my patch:
$ ls -1 *.xdb
ib_modified_
ib_modified_
ib_modified_
$ echo PURGE CHANGED_
$ ls -1 *.xdb
ib_modified_
ib_modified_
Without my patch, XtraBackup must perform a full table scan in incremental mode since the bitmap files do not represent the entire range of LSNs.
Related branches
- Laurynas Biveinis: Resubmit on 2013-12-13
-
Diff: 23 lines (+11/-2)1 file modifiedPercona-Server/storage/innobase/log/log0online.cc (+11/-2)
- Laurynas Biveinis: Approve on 2013-12-17
- George Ormond Lorch III: Pending (g2) requested 2013-12-15
-
Diff: 184 lines (+73/-10)3 files modifiedPercona-Server/mysql-test/suite/innodb_plugin/r/percona_changed_page_bmp_requests.result (+23/-1)
Percona-Server/mysql-test/suite/innodb_plugin/t/percona_changed_page_bmp_requests.test (+34/-6)
Percona-Server/storage/innodb_plugin/log/log0online.c (+16/-3)
- Laurynas Biveinis: Approve on 2013-12-17
- George Ormond Lorch III: Pending (g2) requested 2013-12-15
-
Diff: 184 lines (+73/-10)3 files modifiedPercona-Server/mysql-test/suite/innodb/r/percona_changed_page_bmp_requests.result (+23/-1)
Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp_requests.test (+34/-6)
Percona-Server/storage/innobase/log/log0online.c (+16/-3)
- Laurynas Biveinis: Approve on 2013-12-17
- George Ormond Lorch III: Pending (g2) requested 2013-12-15
-
Diff: 189 lines (+75/-12)3 files modifiedPercona-Server/mysql-test/suite/innodb/r/percona_changed_page_bmp_requests.result (+26/-3)
Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp_requests.test (+35/-6)
Percona-Server/storage/innobase/log/log0online.cc (+14/-3)
description: | updated |
tags: | added: bitmap |
Andrew Gaul (gaul) wrote : | #2 |
Thanks Laurynas, your amended commit with the off-by-one change makes sense. Can you help me understand this test:
PURGE CHANGED_
ib_modified_
ib_modified_
ib_modified_
I expect this to remove ib_modified_
Andrew -
Indeed it should, but currently does not. The problem here is that log_online_
I am modifying the fix so that log_online_
Andrew Gaul (gaul) wrote : | #4 |
Looks good, thanks Laurynas!
Shahriyar Rzayev (rzayev-sehriyar) wrote : | #5 |
Percona now uses JIRA for bug reports so this bug report is migrated to: https:/
Andrew -
Thanks for the bug report and the patch. I am testing your patch and will apply it, with modifications:
- log_online_ purge_changed_ page_bitmaps( ) called with LSN 0 or LSN_MAX is used by RESET BITMAPS that should delete everything. Since the fix means that the last bitmap file in the range will never be deleted if it's the last bitmap file in the directory (as it may contain LSN data up to infinity), it had to be special-cased or RESET BITMAPS would leave that last file. log_1_0. xdb, ib_modified_ log_2_100. xdb and issue PURGE BEFORE 100, it would leave the 1st file although it may be safely deleted.
- There is an off-by-one error in start_lsn >= lsn comparison. I.e. if you have ib_modified_
- Added an MTR testcase.