[arch-commits] Commit in mariadb/trunk (3 files)

Christian Hesse eworm at archlinux.org
Fri Jan 25 14:12:40 UTC 2019


    Date: Friday, January 25, 2019 @ 14:12:39
  Author: eworm
Revision: 344763

get patch from upstream

Added:
  mariadb/trunk/0001-MDEV-18360-Prevent-set_max_open_files-from-allocating-too-many-files.patch
Modified:
  mariadb/trunk/PKGBUILD
Deleted:
  mariadb/trunk/0001-systemd-240.patch

---------------------------------------------------------------------------------+
 0001-MDEV-18360-Prevent-set_max_open_files-from-allocating-too-many-files.patch |   31 ++++++++++
 0001-systemd-240.patch                                                          |   18 -----
 PKGBUILD                                                                        |    8 +-
 3 files changed, 35 insertions(+), 22 deletions(-)

Added: 0001-MDEV-18360-Prevent-set_max_open_files-from-allocating-too-many-files.patch
===================================================================
--- 0001-MDEV-18360-Prevent-set_max_open_files-from-allocating-too-many-files.patch	                        (rev 0)
+++ 0001-MDEV-18360-Prevent-set_max_open_files-from-allocating-too-many-files.patch	2019-01-25 14:12:39 UTC (rev 344763)
@@ -0,0 +1,31 @@
+From 8b87e87252f7d0599a99f18cd5f51914d2611397 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Vicen=C8=9Biu=20Ciorbaru?= <vicentiu at mariadb.org>
+Date: Thu, 24 Jan 2019 00:58:20 +0200
+Subject: MDEV-18360 Prevent set_max_open_files from allocating too many files
+
+If the rlimit.rlim_cur value returned by getrlimit is not the
+RLIM_INFINITY magic constant, but a *very* large number, we can allocate
+too many open files. Restrict set_max_open_files to only return at most
+max_file_limit, as passed via its parameter.
+---
+ mysys/my_file.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/mysys/my_file.c b/mysys/my_file.c
+index 8d01285a94b..b3aef8494cb 100644
+--- a/mysys/my_file.c
++++ b/mysys/my_file.c
+@@ -52,10 +52,9 @@ static uint set_max_open_files(uint max_file_limit)
+     DBUG_PRINT("info", ("rlim_cur: %u  rlim_max: %u",
+ 			(uint) rlimit.rlim_cur,
+ 			(uint) rlimit.rlim_max));
+-    if ((ulonglong) rlimit.rlim_cur == (ulonglong) RLIM_INFINITY)
+-      rlimit.rlim_cur = max_file_limit;
+-    if (rlimit.rlim_cur >= max_file_limit)
+-      DBUG_RETURN(rlimit.rlim_cur);		/* purecov: inspected */
++    if ((ulonglong) rlimit.rlim_cur == (ulonglong) RLIM_INFINITY ||
++        rlimit.rlim_cur >= max_file_limit)
++      DBUG_RETURN(max_file_limit);
+     rlimit.rlim_cur= rlimit.rlim_max= max_file_limit;
+     if (setrlimit(RLIMIT_NOFILE, &rlimit))
+       max_file_limit= old_cur;			/* Use original value */

Deleted: 0001-systemd-240.patch
===================================================================
--- 0001-systemd-240.patch	2019-01-25 13:49:36 UTC (rev 344762)
+++ 0001-systemd-240.patch	2019-01-25 14:12:39 UTC (rev 344763)
@@ -1,18 +0,0 @@
-diff --git a/mysys/my_file.c b/mysys/my_file.c
-index a23ab487d00..23226595b2e 100644
---- a/mysys/my_file.c
-+++ b/mysys/my_file.c
-@@ -52,10 +52,9 @@ static uint set_max_open_files(uint max_file_limit)
-     DBUG_PRINT("info", ("rlim_cur: %u  rlim_max: %u",
- 			(uint) rlimit.rlim_cur,
- 			(uint) rlimit.rlim_max));
--    if ((ulonglong) rlimit.rlim_cur == (ulonglong) RLIM_INFINITY)
--      rlimit.rlim_cur = max_file_limit;
--    if (rlimit.rlim_cur >= max_file_limit)
--      DBUG_RETURN(rlimit.rlim_cur);		/* purecov: inspected */
-+    if ((ulonglong) rlimit.rlim_cur == (ulonglong) RLIM_INFINITY ||
-+        rlimit.rlim_cur >= max_file_limit)
-+      DBUG_RETURN(max_file_limit);
-     rlimit.rlim_cur= rlimit.rlim_max= max_file_limit;
-     if (setrlimit(RLIMIT_NOFILE, &rlimit))
-       max_file_limit= old_cur;			/* Use original value */

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2019-01-25 13:49:36 UTC (rev 344762)
+++ PKGBUILD	2019-01-25 14:12:39 UTC (rev 344763)
@@ -13,10 +13,10 @@
              'openssl' 'systemd' 'zlib' 'zstd')
 validpgpkeys=('199369E5404BD5FC7D2FE43BCBCB082A1BB943DB') # MariaDB Package Signing Key <package-signing-key at mariadb.org>
 source=("https://ftp.heanet.ie/mirrors/mariadb/mariadb-$pkgver/source/mariadb-$pkgver.tar.gz"{,.asc}
-        '0001-systemd-240.patch')
+        '0001-MDEV-18360-Prevent-set_max_open_files-from-allocating-too-many-files.patch')
 sha256sums=('f7449a34c25e0455928d7983dae83fd2069fe1f16c4c5f4aeed9ed9d3f081ff6'
             'SKIP'
-            'd57500014f50d73fe7f35a4503488fb1008bbd15cbcc6ec9aa927fc801e816f4')
+            'f2a93769bfd9a5421871846b091ff752dfceea1791beab2ee55ac93d24df02c7')
 
 prepare() {
   cd $pkgbase-$pkgver/
@@ -39,11 +39,11 @@
   # fix path to our config
   sed -i 's|my.cnf.d|mysql/my.cnf.d|' support-files/rpm/{my.cnf,enable_encryption.preset}
 
-  # fix memory allocation and OOM with systemd >= 240
+  # MDEV-18360 Prevent set_max_open_files from allocating too many files
   # https://bugs.archlinux.org/task/61433
   # https://github.com/systemd/systemd/issues/11510
   # https://jira.mariadb.org/browse/MDEV-18360
-  patch -Np1 < ../0001-systemd-240.patch
+  patch -Np1 < ../0001-MDEV-18360-Prevent-set_max_open_files-from-allocating-too-many-files.patch
 }
 
 build() {


More information about the arch-commits mailing list