Skip to content
Permalink
Browse files
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
  • Loading branch information
dr-m committed Jul 27, 2021
1 parent cf1fc59 commit da09418
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
@@ -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;
@@ -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;

0 comments on commit da09418

Please sign in to comment.