Race condition between checking status of and deleting a bitmap file

Bug #1184517 reported by Laurynas Biveinis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Fix Released
Low
Laurynas Biveinis
5.1
Fix Released
Low
Laurynas Biveinis
5.5
Fix Released
Low
Laurynas Biveinis
5.6
Fix Released
Low
Laurynas Biveinis

Bug Description

Split from bug 1182793:

- a call to log_online_should_overwrite(bitmap file) finding a 0-sized file :

 /* Currently, it's OK to overwrite 0-sized files only */
 success = os_file_get_status(path, &file_info, false);
 return success && file_info.size == 0LL;

- then log_online_start_bitmap_file() trying to delete it and failing because the file is not found, and then aborting the file create.

 /* Check for an old file that should be deleted first */
 if (log_online_should_overwrite(log_bmp_sys->out.name)) {

  success = static_cast<ibool>(
   os_file_delete(innodb_file_bmp_key,
           log_bmp_sys->out.name));
 }

...

 if (UNIV_UNLIKELY(!success)) {

  /* The following call prints an error message */
  os_file_get_last_error(TRUE);
  ib_logf(IB_LOG_LEVEL_ERROR,
   "cannot create \'%s\'\n", log_bmp_sys->out.name);
  log_bmp_sys->out.file = -1;
  return FALSE;
 }

The fix is to ignore file-not-found for the delete attempt.

Tags: bitmap xtradb

Related branches

tags: added: bitmap xtradb
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-2022

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.