Created by Laurynas Biveinis and last modified
Get this branch:
bzr branch lp:~laurynas-biveinis/percona-server/bmp-fixes-5.1
Only Laurynas Biveinis can upload to this branch. If you are Laurynas Biveinis please log in for upload directions.

Branch merges

Related bugs

Related blueprints

Branch information

Recent revisions

552. By Laurynas Biveinis


  queriable when the log tracker is not running);

- bug 1184427 (Failing assertion: i->in_files.count > 0 in file
  log0online.cc line 1511 | abort in log_online_bitmap_iterator_init).

I_S.INNODB_CHANGED_PAGES querying is needlessly limited to require
running log tracker, although there is no dependency in the code of
any kind. Remove this requirement. Then, I_C_P queries may fail if
no bitmaps are found for the requested range (or any bitmaps at all,
if, for example, log tracker was never enabled for the instance).
Fix by adjusting the bitmap file iterator to support iterating over
empty range.

Adjust percona_changed_pages_empty testcase comments to reflect the
reality. Add the test to percona_changed_pages that bitmaps are read
the same way regardless of log tracking status. Robustify
percona_changed_pages_empty testcase against bitmaps present from
previous testcases.

551. By Laurynas Biveinis

Fix bug 1131949 (server won't start when flush_method=ALL_O_DIRECT and

The issue is that bitmap tracking performs the log read I/Os following
the same configuration as the log subsystem itself. That is, if
innodb_flush_method=ALL_O_DIRECT, then the log files have O_DIRECT set
on them, and the read buffer must be block-aligned, but it was not.

Fix by aligning the log tracker log reader buffer at

550. By Laurynas Biveinis


  server with an I/O error if a bitmap file in the middle of requested
  range is missing);

  return a warning if the result set is partial).

files on disk to return queries, but there is no guarantee that these
files will complete and non-corrupt for a given query LSN range. The
code failed to handle several of these situations correctly, resulting
in a server crash (bug 1179974) and the presence of such failures was
not returned to the client (bug 1185040).

Fix by
- Updating the bitmap reader with the latest code from XtraBackup 2.1,
  where several missing bitmap file scenarios have been handled
- Making os_file_close_no_error_handling() available if
  !UNIV_HOTBACKUP too, and using it instead of os_file_close() in the
  bitmap file reader.
- Preventing a double bitmap file close on I/O error by setting the
  bitmap file handle to os_file_invalid and checking it in
- Adding a new flag failed to struct log_bitmap_iterator_struct. Set
  this flag whenever missing bitmap data or an I/O error prevents the
  I_S query from returning full result set.
- Checking that flag in the INFORMATION_SCHEMA plugin and returning
  ER_CANT_FIND_SYSTEM_REC if it's set.
- Adding a testcase to percona_changed_pages.test.

549. By Laurynas Biveinis

Fix bug 1184517 (Race condition between checking status of and
deleting a bitmap file).

If an old bitmap file is to be removed, then ENOENT error while trying
to delete is by definition to be ignored. Fixed by replacing
os_file_delete() call with os_file_delete_if_exists() in

At the same time tighten the log_online_should_overwrite() check by
checking the type of the file as well.

No testsuite changes because they would require a DEBUG_SYNC, and this
code runs only during the startup with predictable file names.

548. By Laurynas Biveinis

Fix bug 1171699 (Log tracking should not acquire log mutex for log

The issue is that log_group_read_log_seg() requires the log mutex and
holds it through the read operation itself. Fixed adding a new arg
specifying whether the mutex should be released before the actual read
I/O operation.

547. By Laurynas Biveinis

Fix bug 1181887 (Error: Cannot create

The cause is a missing path separator between the directory and file
name components in a bitmap file name, which happens if
innodb_data_home_dir does not end in a path separator.

Fix by introducing new field bmp_file_home in log_bitmap_struct,
initializing it from srv_data_home in log_online_read_init(), and
adding a trailing path separator if needed. Then use this field
instead of srv_data_home throughout the bitmap file writer. The
bitmap file reader seems to be unaffected and continues to use

Add a testcase to percona_changed_page_bmp.

546. By Laurynas Biveinis

Fix bug 1132412 (Typo in percona_changed_page_bmp_flush.test precludes
ALL_O_DIRECT testing) by fixing the test to actually test

545. By Laurynas Biveinis

Fix bug 1153651 (Windows warnings comparing HANDLE and -1).

On Windows it does not make sense to compare or set os_file_t values
which is of type HANDLE there, which is a pointer, to -1. Thus
introduce new define in os0file.h, os_file_invalid, which expands to
INVALID_HANDLE_VALUE on Windows and -1 otherwise and use it throughout
log0online.c. Remove os_file_t assignment to -1 in
log_online_start_bitmap_file() where it is redundant due ot
os_file_create_simple_no_error_handling() already setting it for us.

544. By <email address hidden>

Merge lp:~akopytov/percona-server/bug989253-5.1

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
Stacked on:
This branch contains Public information 
Everyone can see this information.