]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/s3vectors: support realm reload for background
authorYuval Lifshitz <ylifshit@ibm.com>
Tue, 14 Apr 2026 14:28:52 +0000 (14:28 +0000)
committerYuval Lifshitz <ylifshit@ibm.com>
Wed, 1 Jul 2026 15:19:31 +0000 (15:19 +0000)
Signed-off-by: Yuval Lifshitz <ylifshit@ibm.com>
src/rgw/rgw_appmain.cc
src/rgw/rgw_lib.cc
src/rgw/rgw_main.cc
src/rgw/rgw_main.h
src/rgw/rgw_s3vector_background.cc
src/rgw/rgw_s3vector_background.h

index a7858fa471b2414ec697917a8e6d462ab021be21..a5f8c26cf308d748806fb9c495d963c8bce65a87 100644 (file)
@@ -519,8 +519,6 @@ int rgw::AppMain::init_frontends2(RGWLib* rgwlib)
     derr << "ERROR: failed to register to service map: " << cpp_strerror(-r) << dendl;
     /* ignore error */
   }
-  s3vector::init(dpp, env.driver);
-
 #ifdef WITH_RADOSGW_RADOS
   if (env.driver->get_name() == "rados") {
     // add a watcher to respond to realm configuration changes
@@ -540,6 +538,9 @@ int rgw::AppMain::init_frontends2(RGWLib* rgwlib)
       }
     if (dedup_background) {
       rgw_pauser->add_pauser(dedup_background.get());
+    }
+    if (s3vector_pauser) {
+      rgw_pauser->add_pauser(s3vector_pauser.get());
     }
       reloader = std::make_unique<RGWRealmReloader>(
           env, *implicit_tenant_context, service_map_meta, rgw_pauser.get(), context_pool_holder.get());
@@ -617,6 +618,12 @@ void rgw::AppMain::init_kms_cache()
       dpp->get_cct(), Keyring::get_best());
 }
 
+void rgw::AppMain::init_s3vector()
+{
+  s3vector::init(dpp, env.driver);
+  s3vector_pauser = std::make_unique<S3VectorPauser>(dpp);
+}
+
 void rgw::AppMain::shutdown(std::function<void(void)> finalize_async_signals)
 {
   // stop the realm reloader
@@ -658,6 +665,7 @@ void rgw::AppMain::shutdown(std::function<void(void)> finalize_async_signals)
   }
 
   s3vector::shutdown();
+  s3vector_pauser.reset();
 
   env.driver->shutdown();
   // Do this before closing storage so requests don't try to call into
index 2ea765b1390cd3d87dc5ec754f09faaf02a626b0..d066d1b00d90c52a64605a663b1c925dc0dd77d6 100644 (file)
@@ -545,6 +545,7 @@ namespace rgw {
     }
 
     main.init_lua();
+    main.init_s3vector();
 #ifdef WITH_RADOSGW_RADOS
     main.init_dedup();
 #endif
index ebdff90c33325a7d83db58925b4dc504d60b4d5a..79cf76605783eec74ddf7a1d33114c1530b7b606 100644 (file)
@@ -166,6 +166,7 @@ int main(int argc, char *argv[])
   main.init_tracepoints();
   main.init_lua();
   main.init_kms_cache();
+  main.init_s3vector();
 #ifdef WITH_RADOSGW_RADOS
   main.init_dedup();
 #endif
index 66f4c932af7f9722870d9c78b715ac9e7b92217e..adcdc9cd29153333be213b7cdf71e581dc4525df 100644 (file)
@@ -31,6 +31,7 @@
 #ifdef WITH_RADOSGW_RADOS
 #include "rgw_dedup.h"
 #endif
+#include "rgw_s3vector_background.h"
 #include "rgw_dmclock_scheduler_ctx.h"
 #include "rgw_ratelimit.h"
 
@@ -54,6 +55,18 @@ public:
 
 };
 
+class S3VectorPauser : public RGWRealmReloader::Pauser {
+  const DoutPrefixProvider* dpp;
+public:
+  S3VectorPauser(const DoutPrefixProvider* dpp) : dpp(dpp) {}
+  void pause() override {
+    rgw::s3vector::pause();
+  }
+  void resume(rgw::sal::Driver* driver) override {
+    rgw::s3vector::resume(dpp, driver);
+  }
+};
+
 namespace rgw {
 
 namespace lua { class Background; }
@@ -75,6 +88,7 @@ class AppMain {
   std::unique_ptr<rgw::LDAPHelper> ldh;
   RGWREST rest;
   std::unique_ptr<rgw::lua::Background> lua_background;
+  std::unique_ptr<S3VectorPauser> s3vector_pauser;
 #ifdef WITH_RADOSGW_RADOS
   std::unique_ptr<rgw::dedup::Background> dedup_background;
 #endif
@@ -139,6 +153,7 @@ public:
   void init_tracepoints();
   void init_lua();
   void init_kms_cache();
+  void init_s3vector();
 #ifdef WITH_RADOSGW_RADOS
   void init_dedup();
 #endif
index d2dcda0a197904805df263ad7459265011afc5ac..95e228504e20bc884d7ad06658ddc8c09d795eb7 100644 (file)
@@ -259,6 +259,14 @@ void shutdown() {
   s_manager.reset();
 }
 
+void pause() {
+  shutdown();
+}
+
+void resume(const DoutPrefixProvider* dpp, rgw::sal::Driver* driver) {
+  init(dpp, driver);
+}
+
 bool notify_index_update(const DoutPrefixProvider* dpp, const std::string& bucket_name, const std::string& index_name) {
   if (!s_manager) {
     ldpp_dout(dpp, 1) << "ERROR: failed to notify s3vectors manager about table update: manager is not initialized" << dendl;
index 2ee8d72a2e95b29af64fc7b7117dbb4e1f84acd4..4758b4ec15f65f2eb7782117461b6c556010b1fd 100644 (file)
@@ -13,6 +13,8 @@ class DoutPrefixProvider;
 namespace rgw::s3vector {
   bool init(const DoutPrefixProvider* dpp, rgw::sal::Driver* driver);
   void shutdown();
+  void pause();
+  void resume(const DoutPrefixProvider* dpp, rgw::sal::Driver* driver);
   // update whenever new vectors are added to an index
   bool notify_index_update(const DoutPrefixProvider* dpp, const std::string& bucket_name, const std::string& index_name);
 }