Race condition in directory creation with parallel backups

Bug #717784 reported by Alexey Kopytov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona XtraBackup moved to https://jira.percona.com/projects/PXB
Fix Released
Undecided
Alexey Kopytov

Bug Description

Sometimes --parallel fails like this:

xtrabackup: Error: cannot mkdir 17: /home/alexey.kopytov/src/percona/percona-xtrabackup/test/var/backup/2011-02-12_07-26-02/sakila
xtrabackup Ver undefined Rev undefined for 5.1.53 unknown-linux-gnu (x86_64)
xtrabackup: Starting 8 threads for parallel data files transfer
innobackupex-1.5.1: Error: ibbackup child process has died at /home/alexey.kopytov/src/percona/percona-xtrabackup/Percona-Server/storage/innodb_plugin/xtrabackup/innobackupex-1.5.1 line 559.

The reason is the following code in xtrabackup.c:

  if (!my_stat(path, &stat_info, MYF(0)) &&
      my_mkdir(path,0777,MYF(0)) < 0) {
   log("xtrabackup: Error: cannot mkdir %d: %s\n",
       my_errno, path);
   return -1;

That code fails when a directory with the same name is created between my_stat() and my_mkdir() calls by a concurrent thead.

Related branches

Revision history for this message
Alexey Kopytov (akopytov) wrote :

Steps to reproduce: run the xb_parallel test on a multi-core machine. It may take a few runs to repeat.

Changed in percona-xtrabackup:
assignee: nobody → Alexey Kopytov (akopytov)
Changed in percona-xtrabackup:
status: New → Fix Committed
Changed in percona-xtrabackup:
milestone: none → 1.6
Changed in percona-xtrabackup:
status: Fix Committed → Fix Released
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/PXB-1114

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.