mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 19:11:46 +01:00
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
This commit is contained in:
parent
5cdc5685d0
commit
87f5dfe1cd
2 changed files with 18 additions and 1 deletions
|
@ -94,7 +94,8 @@ log. */
|
|||
#define OS_FILE_PATH_ERROR 74
|
||||
#define OS_FILE_AIO_RESOURCES_RESERVED 75 /* wait for OS aio resources
|
||||
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 */
|
||||
#define OS_FILE_READ 10
|
||||
|
|
16
os/os0file.c
16
os/os0file.c
|
@ -250,6 +250,15 @@ os_file_get_last_error(
|
|||
"InnoDB: the directory. It may also be"
|
||||
" you have created a subdirectory\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 {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Some operating system error numbers"
|
||||
|
@ -268,6 +277,9 @@ os_file_get_last_error(
|
|||
return(OS_FILE_DISK_FULL);
|
||||
} else if (err == ERROR_FILE_EXISTS) {
|
||||
return(OS_FILE_ALREADY_EXISTS);
|
||||
} else if (err == ERROR_SHARING_VIOLATION
|
||||
|| err == ERROR_LOCK_VIOLATION) {
|
||||
return(OS_FILE_SHARING_VIOLATION);
|
||||
} else {
|
||||
return(100 + err);
|
||||
}
|
||||
|
@ -388,6 +400,10 @@ os_file_handle_error_cond_exit(
|
|||
|| err == OS_FILE_PATH_ERROR) {
|
||||
|
||||
return(FALSE);
|
||||
} else if (err == OS_FILE_SHARING_VIOLATION) {
|
||||
|
||||
os_thread_sleep(10000000); /* 10 sec */
|
||||
return(TRUE);
|
||||
} else {
|
||||
if (name) {
|
||||
fprintf(stderr, "InnoDB: File name %s\n", name);
|
||||
|
|
Loading…
Add table
Reference in a new issue