Commit 87f5dfe1 authored by vasil's avatar vasil

Fix Bug#9709 by retrying (forever) if ERROR_SHARING_VIOLATION or

ERROR_LOCK_VIOLATION is encountered during file operation.
This is caused by backup software, so InnoDB should retry while the backup
software is done with the file.

Approved by:	Heikki
parent 5cdc5685
...@@ -94,7 +94,8 @@ log. */ ...@@ -94,7 +94,8 @@ log. */
#define OS_FILE_PATH_ERROR 74 #define OS_FILE_PATH_ERROR 74
#define OS_FILE_AIO_RESOURCES_RESERVED 75 /* wait for OS aio resources #define OS_FILE_AIO_RESOURCES_RESERVED 75 /* wait for OS aio resources
to become available again */ to become available again */
#define OS_FILE_ERROR_NOT_SPECIFIED 76 #define OS_FILE_SHARING_VIOLATION 76
#define OS_FILE_ERROR_NOT_SPECIFIED 77
/* Types for aio operations */ /* Types for aio operations */
#define OS_FILE_READ 10 #define OS_FILE_READ 10
......
...@@ -250,6 +250,15 @@ os_file_get_last_error( ...@@ -250,6 +250,15 @@ os_file_get_last_error(
"InnoDB: the directory. It may also be" "InnoDB: the directory. It may also be"
" you have created a subdirectory\n" " you have created a subdirectory\n"
"InnoDB: of the same name as a data file.\n"); "InnoDB: of the same name as a data file.\n");
} else if (err == ERROR_SHARING_VIOLATION
|| err == ERROR_LOCK_VIOLATION) {
fprintf(stderr,
"InnoDB: The error means that another program"
" is using InnoDB's files.\n"
"InnoDB: This might be a backup or antivirus"
" software or another instance\n"
"InnoDB: of MySQL."
" Please close it to get rid of this error.\n");
} else { } else {
fprintf(stderr, fprintf(stderr,
"InnoDB: Some operating system error numbers" "InnoDB: Some operating system error numbers"
...@@ -268,6 +277,9 @@ os_file_get_last_error( ...@@ -268,6 +277,9 @@ os_file_get_last_error(
return(OS_FILE_DISK_FULL); return(OS_FILE_DISK_FULL);
} else if (err == ERROR_FILE_EXISTS) { } else if (err == ERROR_FILE_EXISTS) {
return(OS_FILE_ALREADY_EXISTS); return(OS_FILE_ALREADY_EXISTS);
} else if (err == ERROR_SHARING_VIOLATION
|| err == ERROR_LOCK_VIOLATION) {
return(OS_FILE_SHARING_VIOLATION);
} else { } else {
return(100 + err); return(100 + err);
} }
...@@ -388,6 +400,10 @@ os_file_handle_error_cond_exit( ...@@ -388,6 +400,10 @@ os_file_handle_error_cond_exit(
|| err == OS_FILE_PATH_ERROR) { || err == OS_FILE_PATH_ERROR) {
return(FALSE); return(FALSE);
} else if (err == OS_FILE_SHARING_VIOLATION) {
os_thread_sleep(10000000); /* 10 sec */
return(TRUE);
} else { } else {
if (name) { if (name) {
fprintf(stderr, "InnoDB: File name %s\n", name); fprintf(stderr, "InnoDB: File name %s\n", name);
......
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