summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-07-27 08:52:59 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-07-27 08:52:59 +0300
commitda094188f60bf67e3d90227304a4ea256fe2630f (patch)
treea233942b4e5fa906a0abca881bede6fc6a2751ef
parentcf1fc59856daa4c5730737541126d5492a091722 (diff)
downloadmariadb-git-da094188f60bf67e3d90227304a4ea256fe2630f.tar.gz
MDEV-24393 InnoDB disregards --skip-external-locking
On POSIX systems, InnoDB would unconditionally acquire advisory locks on the files that it opens. On Linux, this would be observable by a large number of entries in /proc/locks. Other storage engines would only acquire advisory locks on files based on the Boolean configuration parameter external_locking. Let InnoDB do the same. NOTE: The --skip-external-locking is activated by default. To have InnoDB acquire advisory locks, --external-locking must be specified. Reviewed by: Sergei Golubchik
-rw-r--r--include/my_sys.h5
-rw-r--r--storage/innobase/os/os0file.cc4
2 files changed, 7 insertions, 2 deletions
diff --git a/include/my_sys.h b/include/my_sys.h
index ac1730eeaff..1d2fff0e476 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
- Copyright (c) 2010, 2017, MariaDB Corporation.
+ Copyright (c) 2010, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -279,7 +279,8 @@ extern int my_umask_dir,
extern my_bool my_use_symdir;
extern ulong my_default_record_cache_size;
-extern my_bool my_disable_locking, my_disable_async_io,
+extern MYSQL_PLUGIN_IMPORT my_bool my_disable_locking;
+extern my_bool my_disable_async_io,
my_disable_flush_key_blocks, my_disable_symlinks;
extern my_bool my_disable_sync, my_disable_copystat_in_redel;
extern char wild_many,wild_one,wild_prefix;
diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc
index 884cadaf9f6..a793f9b30cb 100644
--- a/storage/innobase/os/os0file.cc
+++ b/storage/innobase/os/os0file.cc
@@ -1122,6 +1122,10 @@ os_file_lock(
int fd,
const char* name)
{
+ if (my_disable_locking) {
+ return 0;
+ }
+
struct flock lk;
lk.l_type = F_WRLCK;