[arch-commits] Commit in ceph/trunk (2 files)

Thore Bödecker foxxx0 at archlinux.org
Tue Apr 6 15:03:31 UTC 2021


    Date: Tuesday, April 6, 2021 @ 15:03:31
  Author: foxxx0
Revision: 912123

upgpkg: ceph 15.2.10-1

update to upstream release 15.2.10
fixes FS#70062

backport upstream workaround for incompatible mgr modules, references:
https://tracker.ceph.com/issues/45147
https://github.com/ceph/ceph/pull/34846
fixes FS#68726

Added:
  ceph/trunk/backport_mgr_disabled_modules_workaround_PR34846.patch
Modified:
  ceph/trunk/PKGBUILD

--------------------------------------------------------+
 PKGBUILD                                               |   23 +
 backport_mgr_disabled_modules_workaround_PR34846.patch |  207 +++++++++++++++
 2 files changed, 222 insertions(+), 8 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-04-06 14:43:04 UTC (rev 912122)
+++ PKGBUILD	2021-04-06 15:03:31 UTC (rev 912123)
@@ -3,9 +3,9 @@
 
 pkgbase='ceph'
 pkgname=('ceph' 'ceph-libs' 'ceph-mgr')
-_zstdver=1.4.5
-pkgver=15.2.8
-pkgrel=2
+_zstdver=1.4.9
+pkgver=15.2.10
+pkgrel=1
 pkgdesc='Distributed, fault-tolerant storage platform delivering object, block, and file system'
 arch=('x86_64')
 url='https://ceph.com/'
@@ -43,7 +43,7 @@
   "https://download.ceph.com/tarballs/${pkgbase}-${pkgver}.tar.gz"
   'ceph.sysusers'
   "zstd-${_zstdver}.tar.gz::https://github.com/facebook/zstd/archive/v${_zstdver}.tar.gz"
-  'glibc2.32-strsignal-compat-backported.patch'
+  #'glibc2.32-strsignal-compat-backported.patch'
   'ceph-14.2.0-cflags.patch'
   'ceph-12.2.4-boost-build-none-options.patch'
   'ceph-13.2.0-cflags.patch'
@@ -56,11 +56,17 @@
   'disable-empty-readable.sh-test.patch'
   'qa-src-update-mypy-to-0.782.patch'
   'fix-mgr-dashboard-partial_dict.patch'
+
+  # Add python >= 3.8 workaround logic for incompatible modules
+  # This has been designated for upstream backporting into the octupus (15) and pacific (16) branches.
+  # TODO: check if merged and included in next releases
+  # https://tracker.ceph.com/issues/45147
+  # https://github.com/ceph/ceph/pull/34846
+  'backport_mgr_disabled_modules_workaround_PR34846.patch'
 )
-sha512sums=('66c7322575165b4747955ac9de34f9f9e2d4361c8cd8498819383883045601b92f786c4336c79369d6f019db1c4524c492faa40cdceed7fc1b2b373ca6ab5065'
+sha512sums=('20202c07a068f99d5ce56b1969f703f996ad34c201ea3ab9bb05ea278afac71ccba43fb03e9de641dc3ab9692eecfcc6f52ff1ac03e13a1dc2f939bd8159fc2d'
             '4354001c1abd9a0c385ba7bd529e3638fb6660b6a88d4e49706d4ac21c81b8e829303a20fb5445730bdac18c4865efb10bc809c1cd56d743c12aa9a52e160049'
-            'b03c497c3e0590c3d384cb856e3024f144b2bfac0d805d80e68deafa612c68237f12a2d657416d476a28059e80936c79f099fc42331464b417593895ea214387'
-            'f4f725db5ce8ff01088557891382f28b014a18accbca40b9939899e611377dc71bc94aa47333bbff544b65a7f7cb680bac4a1359481afe24354a0b5c4a9469e4'
+            'f529db9c094f9ae26428bf1fdfcc91c6d783d400980e0f0d802d2cf13c2be2931465ef568907e03841ff76a369a1447e7371f8799d8526edb9a513ba5c6db133'
             '9e6bb46d5bbdc5d93f4f026b2a8d6bdb692d9ea6e7018c1bb0188d95ea8574c76238d968b340fd67ddaa3d8183b310e393e3549dc3a63a795fde696413b0ca94'
             '6ff46a90d76f667fa23be0f9eb1ed2fb7e30af9a2621aec19944d0a22a431a0f5721603c588286e483ff55c14aac920adfccb039c9678a87cc59640dd70367ae'
             '8ec0d668fefee12d2c7f5b5297dd81fc6a559f5823d069e6395d9b4240110eb8f95049d3054697a459948c1f3784b4450539849cf9d7f3b1aa1c7fbd96c475df'
@@ -72,7 +78,8 @@
             '84de66f64ea96cd59b40dfb5b8c5d093fe49df1139b45ad9d1bd6b9ebd2f1200b6e931adcf032639a4995af322cf05c1ef9050eb1cb6673e29e040d4e348b3d5'
             '2234d005df71b3b6013e6b76ad07a5791e3af7efec5f41c78eb1a9c92a22a67f0be9560be59b52534e90bfe251bcf32c33d5d40163f3f8f7e7420691f0f4a222'
             '204741c65b8ceeddae0a58a49e2b4249ee7ffc624ce8d9faa6284af198abe63bffb6758e064eeff6d1857be044647f99749a45443e258b35e92cc36b9edeba80'
-            '79e337a78cc4bd9ed8c8ab66831b3efd5a3a34e16d2c73ecedef03d2a34c7ac65ea25641a808913cd2dc2dc0f992fac35822efe4188622add6898dce1e5f13e3')
+            '79e337a78cc4bd9ed8c8ab66831b3efd5a3a34e16d2c73ecedef03d2a34c7ac65ea25641a808913cd2dc2dc0f992fac35822efe4188622add6898dce1e5f13e3'
+            'b6e08b21d73fe1485c32b283812f3cf39e31e2fb0f5fc750b2e6ec3c5c4bfd7ac9170c7d5168d172e8af5d98e74d0313c2d090d22490fbd94269b016034a902f')
 
 
 # -fno-plt causes linker errors (undefined reference to internal methods)

Added: backport_mgr_disabled_modules_workaround_PR34846.patch
===================================================================
--- backport_mgr_disabled_modules_workaround_PR34846.patch	                        (rev 0)
+++ backport_mgr_disabled_modules_workaround_PR34846.patch	2021-04-06 15:03:31 UTC (rev 912123)
@@ -0,0 +1,207 @@
+From 40d06ce623f19172721a2f1d5b4f4f8b642a3077 Mon Sep 17 00:00:00 2001
+From: Kefu Chai <kchai at redhat.com>
+Date: Thu, 30 Apr 2020 10:43:01 +0800
+Subject: [PATCH] mgr/PyModuleRegistry: probe modules using std::filesystem
+
+for better readability
+
+Signed-off-by: Kefu Chai <kchai at redhat.com>
+---
+ src/mgr/PyModuleRegistry.cc | 43 +++++++++++++++++--------------------
+ 1 file changed, 20 insertions(+), 23 deletions(-)
+
+diff --git a/src/mgr/PyModuleRegistry.cc b/src/mgr/PyModuleRegistry.cc
+index 440f7c8bafc1e..466da5d404964 100644
+--- a/src/mgr/PyModuleRegistry.cc
++++ b/src/mgr/PyModuleRegistry.cc
+@@ -11,6 +11,17 @@
+  * Foundation.  See file COPYING.
+  */
+ 
++#include "PyModuleRegistry.h"
++
++#if __has_include(<filesystem>)
++#include <filesystem>
++namespace fs = std::filesystem;
++#elif __has_include(<experimental/filesystem>)
++#include <experimental/filesystem>
++namespace fs = std::experimental::filesystem;
++#else
++#error std::filesystem not available!
++#endif
+ 
+ #include "include/stringify.h"
+ #include "common/errno.h"
+@@ -24,8 +35,6 @@
+ 
+ #include "ActivePyModules.h"
+ 
+-#include "PyModuleRegistry.h"
+-
+ #define dout_context g_ceph_context
+ #define dout_subsys ceph_subsys_mgr
+ 
+@@ -258,29 +267,17 @@ void PyModuleRegistry::shutdown()
+ 
+ std::set<std::string> PyModuleRegistry::probe_modules(const std::string &path) const
+ {
+-  DIR *dir = opendir(path.c_str());
+-  if (!dir) {
+-    return {};
+-  }
+-
+-  std::set<std::string> modules_out;
+-  struct dirent *entry = NULL;
+-  while ((entry = readdir(dir)) != NULL) {
+-    string n(entry->d_name);
+-    string fn = path + "/" + n;
+-    struct stat st;
+-    int r = ::stat(fn.c_str(), &st);
+-    if (r == 0 && S_ISDIR(st.st_mode)) {
+-      string initfn = fn + "/module.py";
+-      r = ::stat(initfn.c_str(), &st);
+-      if (r == 0) {
+-	modules_out.insert(n);
+-      }
++  std::set<std::string> modules;
++  for (const auto& entry: fs::directory_iterator(path)) {
++    if (!fs::is_directory(entry)) {
++      continue;
++    }
++    auto module_path = entry.path() / "module.py";
++    if (fs::exists(module_path)) {
++      modules.emplace(entry.path().filename());
+     }
+   }
+-  closedir(dir);
+-
+-  return modules_out;
++  return modules;
+ }
+ 
+ int PyModuleRegistry::handle_command(
+From 067adbf9a032b5de793fd0b41b071f24f075270a Mon Sep 17 00:00:00 2001
+From: Kefu Chai <kchai at redhat.com>
+Date: Thu, 30 Apr 2020 11:34:07 +0800
+Subject: [PATCH] mgr: do not load disabled modules
+
+an option named "mgr_disabled_modules" is added in this change to
+prevent mgr from loading modules listed in this option. because mgr
+loads *all* modules found in the configured path, and per
+https://tracker.ceph.com/issues/45147, python subinterpreter could hang
+when loading numpy, so this behavior practically creates a deadlock
+in mgr.
+
+this issue is found when mgr uses python3.8 runtime. in development
+environment, it'd be inconvenient to disable the offending mgr module
+without changing the source code, even if we can choose to not install
+them, for instance, the enduser can workaround this issue by
+uninstalling `ceph-mgr-diskprediction-local`.
+
+an option would be useful in this case, so we can add the module to the
+list before mgr tries to load it.
+
+as this issue is found with python3.8 + diskprediction_local (numpy), so
+this mgr module is disabled by default if mgr is compiled with python3.8
+runtime.
+
+Fixes: https://tracker.ceph.com/issues/45147
+Signed-off-by: Kefu Chai <kchai at redhat.com>
+---
+ CMakeLists.txt                |  5 +++++
+ src/common/options.cc         | 14 ++++++++++++++
+ src/include/config-h.in.cmake |  3 +++
+ src/mgr/PyModuleRegistry.cc   | 11 ++++++++++-
+ 4 files changed, 32 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0f7e86414c2d2..fa00d1316bcc0 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -442,6 +442,11 @@ if(WITH_MGR)
+   set(MGR_PYTHON_LIBRARIES ${Python3_LIBRARIES})
+   set(MGR_PYTHON_VERSION_MAJOR ${Python3_VERSION_MAJOR})
+   set(MGR_PYTHON_VERSION_MINOR ${Python3_VERSION_MINOR})
++  # https://tracker.ceph.com/issues/45147
++  if(Python3_VERSION VERSION_GREATER_EQUAL 3.8)
++    set(MGR_DISABLED_MODULES "diskprediction_local")
++    message(STATUS "mgr module disabled for ${Python3_VERSION}: ${MGR_DISABLED_MODULES}")
++  endif()
+   # Boost dependency check deferred to Boost section
+ endif(WITH_MGR)
+ 
+diff --git a/src/common/options.cc b/src/common/options.cc
+index be1e955ab51ea..c78d9b69d7591 100644
+--- a/src/common/options.cc
++++ b/src/common/options.cc
+@@ -5169,6 +5169,20 @@ std::vector<Option> get_global_options() {
+     .add_service("mgr")
+     .set_description("Filesystem path to manager modules."),
+ 
++    Option("mgr_disabled_modules", Option::TYPE_STR, Option::LEVEL_ADVANCED)
++#ifdef MGR_DISABLED_MODULES
++    .set_default(MGR_DISABLED_MODULES)
++#endif
++    .set_flag(Option::FLAG_STARTUP)
++    .add_service("mgr")
++    .set_description("List of manager modules never get loaded")
++    .set_long_description("A comma delimited list of module names. This list "
++        "is read by manager when it starts. By default, manager loads all "
++        "modules found in specified 'mgr_module_path', and it starts the "
++        "enabled ones as instructed. The modules in this list will not be "
++        "loaded at all.")
++    .add_see_also("mgr_module_path"),
++
+     Option("mgr_initial_modules", Option::TYPE_STR, Option::LEVEL_BASIC)
+     .set_default("restful iostat")
+     .set_flag(Option::FLAG_NO_MON_UPDATE)
+diff --git a/src/include/config-h.in.cmake b/src/include/config-h.in.cmake
+index dc213938f5c9c..ea550c81e3a0e 100644
+--- a/src/include/config-h.in.cmake
++++ b/src/include/config-h.in.cmake
+@@ -309,6 +309,9 @@
+ 
+ #cmakedefine MGR_PYTHON_EXECUTABLE "@MGR_PYTHON_EXECUTABLE@"
+ 
++/* the default value of "mgr_disabled_module" option */
++#cmakedefine MGR_DISABLED_MODULES "@MGR_DISABLED_MODULES@"
++
+ /* Define to 1 if you have the `getprogname' function. */
+ #cmakedefine HAVE_GETPROGNAME 1
+ 
+diff --git a/src/mgr/PyModuleRegistry.cc b/src/mgr/PyModuleRegistry.cc
+index 466da5d404964..2e2e080aa76c0 100644
+--- a/src/mgr/PyModuleRegistry.cc
++++ b/src/mgr/PyModuleRegistry.cc
+@@ -25,6 +25,7 @@ namespace fs = std::experimental::filesystem;
+ 
+ #include "include/stringify.h"
+ #include "common/errno.h"
++#include "common/split.h"
+ 
+ #include "BaseMgrModule.h"
+ #include "PyOSDMap.h"
+@@ -267,14 +268,22 @@ void PyModuleRegistry::shutdown()
+ 
+ std::set<std::string> PyModuleRegistry::probe_modules(const std::string &path) const
+ {
++  const auto opt = g_conf().get_val<std::string>("mgr_disabled_modules");
++  const auto disabled_modules = ceph::split(opt);
++
+   std::set<std::string> modules;
+   for (const auto& entry: fs::directory_iterator(path)) {
+     if (!fs::is_directory(entry)) {
+       continue;
+     }
++    const std::string name = entry.path().filename();
++    if (std::count(disabled_modules.begin(), disabled_modules.end(), name)) {
++      dout(10) << "ignoring disabled module " << name << dendl;
++      continue;
++    }
+     auto module_path = entry.path() / "module.py";
+     if (fs::exists(module_path)) {
+-      modules.emplace(entry.path().filename());
++      modules.emplace(name);
+     }
+   }
+   return modules;



More information about the arch-commits mailing list