Commit da094188 authored by Marko Mäkelä's avatar Marko Mäkelä

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
parent cf1fc598
/* 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;
......
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