Commit fb466c17 authored by unknown's avatar unknown

os0file.c:

  Fix an assertion about ERROR_LOCK_VIOLATION 33 in file write if InnoDB Hot Backup is run concurrently with mysqld in Windows


innobase/os/os0file.c:
  Fix an assertion about ERROR_LOCK_VIOLATION 33 in file write if InnoDB Hot Backup is run concurrently with mysqld in Windows
parent e7193c63
...@@ -1083,6 +1083,7 @@ os_file_write( ...@@ -1083,6 +1083,7 @@ os_file_write(
DWORD low; DWORD low;
DWORD high; DWORD high;
ulint i; ulint i;
ulint n_retries = 0;
ut_a((offset & 0xFFFFFFFF) == offset); ut_a((offset & 0xFFFFFFFF) == offset);
...@@ -1091,7 +1092,7 @@ os_file_write( ...@@ -1091,7 +1092,7 @@ os_file_write(
ut_ad(file); ut_ad(file);
ut_ad(buf); ut_ad(buf);
ut_ad(n > 0); ut_ad(n > 0);
retry:
low = offset; low = offset;
high = offset_high; high = offset_high;
...@@ -1135,6 +1136,17 @@ os_file_write( ...@@ -1135,6 +1136,17 @@ os_file_write(
return(TRUE); return(TRUE);
} }
/* If InnoDB Hot Backup is running, then, at least in Windows 2000,
we may get here a specific error. Let us retry the operation 10
times. */
if (GetLastError() == ERROR_LOCK_VIOLATION && n_retries < 10) {
n_retries++;
goto retry;
}
if (!os_has_said_disk_full) { if (!os_has_said_disk_full) {
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
...@@ -1147,7 +1159,7 @@ os_file_write( ...@@ -1147,7 +1159,7 @@ os_file_write(
"InnoDB: what the error number means.\n" "InnoDB: what the error number means.\n"
"InnoDB: Check that your OS and file system support files of this size.\n" "InnoDB: Check that your OS and file system support files of this size.\n"
"InnoDB: Check also that the disk is not full or a disk quota exceeded.\n", "InnoDB: Check also that the disk is not full or a disk quota exceeded.\n",
name, offset_high, offset, n, len, name, offset_high, offset, n, (ulint)len,
(ulint)GetLastError()); (ulint)GetLastError());
os_has_said_disk_full = TRUE; os_has_said_disk_full = TRUE;
...@@ -1170,13 +1182,13 @@ os_file_write( ...@@ -1170,13 +1182,13 @@ os_file_write(
fprintf(stderr, fprintf(stderr,
" InnoDB: Error: Write to file %s failed at offset %lu %lu.\n" " InnoDB: Error: Write to file %s failed at offset %lu %lu.\n"
"InnoDB: %lu bytes should have been written, only %lu were written.\n" "InnoDB: %lu bytes should have been written, only %ld were written.\n"
"InnoDB: Operating system error number %lu.\n" "InnoDB: Operating system error number %lu.\n"
"InnoDB: Look from section 13.2 at http://www.innodb.com/ibman.html\n" "InnoDB: Look from section 13.2 at http://www.innodb.com/ibman.html\n"
"InnoDB: what the error number means or use the perror program of MySQL.\n" "InnoDB: what the error number means or use the perror program of MySQL.\n"
"InnoDB: Check that your OS and file system support files of this size.\n" "InnoDB: Check that your OS and file system support files of this size.\n"
"InnoDB: Check also that the disk is not full or a disk quota exceeded.\n", "InnoDB: Check also that the disk is not full or a disk quota exceeded.\n",
name, offset_high, offset, n, (ulint)ret, name, offset_high, offset, n, (long int)ret,
(ulint)errno); (ulint)errno);
os_has_said_disk_full = TRUE; os_has_said_disk_full = TRUE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment