Skip to content

Commit de5099d

Browse files
committed
Remove insufficient locking on Apple
1 parent fa7dc10 commit de5099d

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

storage/innobase/handler/backup_innodb.cc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -574,12 +574,13 @@ class InnoDB_backup
574574
#else
575575
int f;
576576
# ifdef __APPLE__
577-
backup_batch_start(node->space,
578-
(node->space->size +
579-
fil_space_t::BACKUP_BATCH_SIZE - 1) &
580-
~fil_space_t::BACKUP_BATCH_SIZE);
577+
/* aio::synchronous() in another thread may concurrently invoke
578+
pwrite(2) on node->handle. We assume that both pwrite(2) and
579+
fclonefileat(2) are atomic with respect to each other. Should
580+
this assumption be invalid, some data files in the backup may be
581+
corrupted. This corruption can be fixed by either removing this
582+
special handling, or by implementing file-level locking. */
581583
f= fclonefileat(node->handle, target, node->name, 0);
582-
backup_batch_stop(node->space);
583584
if (!f)
584585
break;
585586
switch (errno) {

0 commit comments

Comments
 (0)