]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw/datalog: Manage and shutdown tasks properly
authorAdam C. Emerson <aemerson@redhat.com>
Mon, 30 Jun 2025 20:54:46 +0000 (16:54 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Wed, 6 Aug 2025 02:47:37 +0000 (22:47 -0400)
This is slightly ugly but good enough for now. Make sure we can block
when shutting down background tasks.

Remove a few `driver` parameters that are unused. This lets us
simplify the IAM Policy and Lua tests and not construct stores we
never use. (Which is good since we aren't running them under a cluster.)

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
23 files changed:
src/rgw/driver/rados/rgw_datalog.cc
src/rgw/driver/rados/rgw_datalog.h
src/rgw/driver/rados/rgw_log_backing.cc
src/rgw/driver/rados/rgw_log_backing.h
src/rgw/driver/rados/rgw_sal_rados.cc
src/rgw/driver/rados/rgw_sal_rados.h
src/rgw/driver/rados/rgw_service.cc
src/rgw/driver/rados/rgw_service.h
src/rgw/rgw_appmain.cc
src/rgw/rgw_lua_background.cc
src/rgw/rgw_lua_background.h
src/rgw/rgw_lua_request.cc
src/rgw/rgw_lua_request.h
src/rgw/rgw_op.cc
src/rgw/rgw_op.h
src/rgw/rgw_process.cc
src/rgw/rgw_process_env.h
src/rgw/rgw_rest.cc
src/rgw/rgw_sal.cc
src/rgw/rgw_sal.h
src/test/rgw/test_datalog.cc
src/test/rgw/test_rgw_iam_policy.cc
src/test/rgw/test_rgw_lua.cc

index 9aaec5d16fc7326f7cf092f00fa46e8379aa058b..f30fffd320fe86ba56358ab83206477d27d78b1e 100644 (file)
@@ -131,7 +131,7 @@ class RGWDataChangesOmap final : public RGWDataChangesBE {
   std::vector<std::string> oids;
 
 public:
-  RGWDataChangesOmap(neorados::RADOS& r,
+  RGWDataChangesOmap(neorados::RADOS r,
                     neorados::IOContext loc,
                     RGWDataChangesLog& datalog,
                     uint64_t gen_id,
@@ -272,7 +272,7 @@ class RGWDataChangesFIFO final : public RGWDataChangesBE {
   tiny_vector<LazyFIFO> fifos;
 
 public:
-  RGWDataChangesFIFO(neorados::RADOS& r,
+  RGWDataChangesFIFO(neorados::RADOS r,
                     neorados::IOContext loc,
                     RGWDataChangesLog& datalog,
                     uint64_t gen_id,
@@ -508,12 +508,12 @@ RGWDataChangesLog::start(const DoutPrefixProvider *dpp,
   }
 
   if (renew) {
-    asio::co_spawn(
+    renew_future = asio::co_spawn(
       renew_strand,
-      renew_run(shared_from_this()),
+      renew_run(),
       asio::bind_cancellation_slot(renew_signal.slot(),
                                   asio::bind_executor(renew_strand,
-                                                      asio::detached)));
+                                                      asio::use_future)));
   }
   if (watch) {
     // Establish watch here so we won't be 'started up' until we're watching.
@@ -523,22 +523,22 @@ RGWDataChangesLog::start(const DoutPrefixProvider *dpp,
       throw sys::system_error{ENOTCONN, sys::generic_category(),
                              "Unable to establish recovery watch!"};
     }
-    asio::co_spawn(
+    watch_future = asio::co_spawn(
       watch_strand,
-      watch_loop(shared_from_this()),
+      watch_loop(),
       asio::bind_cancellation_slot(watch_signal.slot(),
                                   asio::bind_executor(watch_strand,
-                                                      asio::detached)));
+                                                      asio::use_future)));
   }
   if (recovery) {
     // Recovery can run concurrent with normal operation, so we don't
     // have to block startup while we do all that I/O.
-    asio::co_spawn(
+    recovery_future = asio::co_spawn(
       recovery_strand,
-      recover(dpp, shared_from_this()),
+      recover(dpp),
       asio::bind_cancellation_slot(recovery_signal.slot(),
                                   asio::bind_executor(recovery_strand,
-                                                      asio::detached)));
+                                                      asio::use_future)));
   }
   co_return;
 }
@@ -665,7 +665,7 @@ RGWDataChangesLog::process_notification(const DoutPrefixProvider* dpp,
 }
 
 asio::awaitable<void>
-RGWDataChangesLog::watch_loop(std::shared_ptr<RGWDataChangesLog>)
+RGWDataChangesLog::watch_loop()
 {
   const DoutPrefix dp(cct, dout_subsys, "rgw data changes log: ");
   const auto oid = get_sem_set_oid(0);
@@ -1351,7 +1351,9 @@ bool RGWDataChangesLog::going_down() const
   return down_flag;
 }
 
-asio::awaitable<void> RGWDataChangesLog::shutdown() {
+// Now, if we had an awaitable future…
+asio::awaitable<void> RGWDataChangesLog::async_shutdown()
+{
   DoutPrefix dp{cct, ceph_subsys_rgw, "Datalog Shutdown"};
   if (down_flag) {
     co_return;
@@ -1377,15 +1379,77 @@ asio::awaitable<void> RGWDataChangesLog::shutdown() {
   if (watchcookie && rados->check_watch(watchcookie)) {
     auto wc = watchcookie;
     watchcookie = 0;
-    co_await rados->unwatch(wc, loc, asio::use_awaitable);
+    try {
+      co_await rados->unwatch(wc, loc, asio::use_awaitable);
+    } catch (const std::exception& e) {
+      ldpp_dout(&dp, 2)
+       << "RGWDataChangesLog::async_shutdown: unwatch failed: " << e.what()
+       << dendl;
+    }
   }
   co_return;
 }
 
-asio::awaitable<void> RGWDataChangesLog::shutdown_or_timeout() {
-  using namespace asio::experimental::awaitable_operators;
-  asio::steady_timer t(co_await asio::this_coro::executor, 3s);
-  co_await (shutdown() || t.async_wait(asio::use_awaitable));
+void RGWDataChangesLog::blocking_shutdown()
+{
+  DoutPrefix dp{cct, ceph_subsys_rgw, "Datalog Shutdown"};
+  if (down_flag) {
+    return;
+  }
+  down_flag = true;
+  if (ran_background)  {
+    renew_stop();
+    // Revisit this later
+    asio::dispatch(renew_strand,
+                  [this]() {
+                    renew_signal.emit(asio::cancellation_type::terminal);
+                  });
+    try {
+      renew_future.wait();
+    } catch (const std::future_error& e) {
+      if (e.code() != std::future_errc::no_state) {
+       throw;
+      }
+    }
+    asio::dispatch(recovery_strand,
+                  [this]() {
+                    recovery_signal.emit(asio::cancellation_type::terminal);
+                  });
+    try {
+      recovery_future.wait();
+    } catch (const std::future_error& e) {
+      if (e.code() != std::future_errc::no_state) {
+       throw;
+      }
+    }
+    asio::dispatch(watch_strand,
+                  [this]() {
+                    watch_signal.emit(asio::cancellation_type::terminal);
+                  });
+    try {
+      watch_future.wait();
+    } catch (const std::future_error& e) {
+      if (e.code() != std::future_errc::no_state) {
+       throw;
+      }
+    }
+    if (watchcookie && rados->check_watch(watchcookie)) {
+      auto wc = watchcookie;
+      watchcookie = 0;
+      try {
+       rados->unwatch(wc, loc, async::use_blocked);
+      } catch (const std::exception& e) {
+       ldpp_dout(&dp, 2)
+         << "RGWDataChangesLog::blocking_shutdown: unwatch failed: " << e.what()
+         << dendl;
+      }
+    }
+  }
+  if (bes) {
+    bes->shutdown();
+    bes.reset();
+  }
+  return;
 }
 
 RGWDataChangesLog::~RGWDataChangesLog() {
@@ -1395,29 +1459,7 @@ RGWDataChangesLog::~RGWDataChangesLog() {
   }
 }
 
-void RGWDataChangesLog::blocking_shutdown() {
-  if (!down_flag) {
-    try {
-      auto eptr = asio::co_spawn(rados->get_io_context(),
-                                shutdown_or_timeout(),
-                                async::use_blocked);
-      if (eptr) {
-       std::rethrow_exception(eptr);
-      }
-    } catch (const sys::system_error& e) {
-      lderr(cct) << __PRETTY_FUNCTION__
-                << ": Failed to shutting down: " << e.what()
-                << dendl;
-    } catch (const std::exception& e) {
-      lderr(cct) << __PRETTY_FUNCTION__
-                << ": Failed to shutting down: " << e.what()
-                << dendl;
-    }
-  }
-}
-
-asio::awaitable<void> RGWDataChangesLog::renew_run(
-  std::shared_ptr<RGWDataChangesLog>) {
+asio::awaitable<void> RGWDataChangesLog::renew_run() {
   static constexpr auto runs_per_prune = 150;
   auto run = 0;
   renew_timer.emplace(co_await asio::this_coro::executor);
@@ -1722,8 +1764,7 @@ RGWDataChangesLog::recover_shard(const DoutPrefixProvider* dpp, int index)
 }
 
 asio::awaitable<void> RGWDataChangesLog::recover(
-  const DoutPrefixProvider* dpp,
-  std::shared_ptr<RGWDataChangesLog>)
+  const DoutPrefixProvider* dpp)
 {
   co_await asio::co_spawn(
     recovery_strand,
index e1846ba505e0e442206f7c04677fdabcf4554569..8da59c67e9d191a787ff3b21884d47e0bac04369 100644 (file)
@@ -4,6 +4,7 @@
 #pragma once
 
 #include <cstdint>
+#include <future>
 #include <list>
 #include <memory>
 #include <mutex>
@@ -14,6 +15,7 @@
 #include <variant>
 #include <vector>
 
+#include <boost/asio/use_future.hpp>
 #include <boost/asio/steady_timer.hpp>
 
 #include <boost/container/flat_map.hpp>
@@ -206,7 +208,7 @@ class DataLogBackends final
   std::mutex m;
   RGWDataChangesLog& datalog;
 
-  DataLogBackends(neorados::RADOS& rados,
+  DataLogBackends(neorados::RADOS rados,
                  const neorados::Object oid,
                  const neorados::IOContext& loc,
                  fu2::unique_function<std::string(
@@ -350,8 +352,7 @@ struct hash<BucketGen> {
 };
 }
 
-class RGWDataChangesLog
-  : public std::enable_shared_from_this<RGWDataChangesLog> {
+class RGWDataChangesLog {
   friend class DataLogTestBase;
   friend DataLogBackends;
   CephContext *cct;
@@ -366,10 +367,13 @@ class RGWDataChangesLog
   using strand_t = asio::strand<executor_t>;
   strand_t renew_strand{executor};
   asio::cancellation_signal renew_signal = asio::cancellation_signal();
+  std::future<void> renew_future;
   strand_t watch_strand{executor};
   asio::cancellation_signal watch_signal = asio::cancellation_signal();
+  std::future<void> watch_future;
   strand_t recovery_strand{executor};
   asio::cancellation_signal recovery_signal = asio::cancellation_signal();
+  std::future<void> recovery_future;
 
   ceph::mono_time last_recovery = ceph::mono_clock::zero();
 
@@ -414,8 +418,7 @@ class RGWDataChangesLog
                      ceph::real_time expiration);
 
   std::optional<asio::steady_timer> renew_timer;
-  asio::awaitable<void> renew_run(
-    std::shared_ptr<RGWDataChangesLog> renew_signal);
+  asio::awaitable<void> renew_run();
   void renew_stop();
 
   std::function<bool(const rgw_bucket& bucket, optional_yield y,
@@ -451,7 +454,7 @@ public:
                                        std::string_view oid);
   asio::awaitable<void> process_notification(const DoutPrefixProvider* dpp,
                                             std::string_view oid);
-  asio::awaitable<void> watch_loop(std::shared_ptr<RGWDataChangesLog>);
+  asio::awaitable<void> watch_loop();
   int choose_oid(const rgw_bucket_shard& bs);
   asio::awaitable<void> add_entry(const DoutPrefixProvider *dpp,
                                  const RGWBucketInfo& bucket_info,
@@ -532,10 +535,8 @@ public:
                 ceph::mono_time fetch_time,
                 bc::flat_map<std::string, uint64_t>&& semcount);
   asio::awaitable<void> recover_shard(const DoutPrefixProvider* dpp, int index);
-  asio::awaitable<void> recover(const DoutPrefixProvider* dpp,
-                               std::shared_ptr<RGWDataChangesLog>);
-  asio::awaitable<void> shutdown();
-  asio::awaitable<void> shutdown_or_timeout();
+  asio::awaitable<void> recover(const DoutPrefixProvider* dpp);
+  asio::awaitable<void> async_shutdown();
   void blocking_shutdown();
 
   asio::awaitable<void> admin_sem_list(std::optional<int> req_shard,
@@ -549,7 +550,7 @@ public:
 
 class RGWDataChangesBE : public boost::intrusive_ref_counter<RGWDataChangesBE> {
 protected:
-  neorados::RADOS& r;
+  neorados::RADOS r;
   neorados::IOContext loc;
   RGWDataChangesLog& datalog;
 
@@ -564,7 +565,7 @@ public:
 
   const uint64_t gen_id;
 
-  RGWDataChangesBE(neorados::RADOS& r,
+  RGWDataChangesBE(neorados::RADOS r,
                   neorados::IOContext loc,
                   RGWDataChangesLog& datalog,
                   uint64_t gen_id)
index 0ea4ff16ddb891c30da2c65b99a87576cc045b87..8e3442d3e8208efa4eb6d89479700b3bd4fda29a 100644 (file)
@@ -52,7 +52,7 @@ inline std::ostream& operator <<(std::ostream& m, const shard_check& t) {
 namespace {
 /// Return the shard type, and a bool to see whether it has entries.
 asio::awaitable<shard_check>
-probe_shard(const DoutPrefixProvider* dpp, neorados::RADOS& rados,
+probe_shard(const DoutPrefixProvider* dpp, neorados::RADOS rados,
            const neorados::Object& obj, const neorados::IOContext& loc,
            bool& fifo_unsupported)
 {
@@ -98,7 +98,7 @@ probe_shard(const DoutPrefixProvider* dpp, neorados::RADOS& rados,
 }
 
 asio::awaitable<log_type> handle_dne(const DoutPrefixProvider *dpp,
-                                    neorados::RADOS& rados,
+                                    neorados::RADOS rados,
                                     const neorados::Object& obj,
                                     const neorados::IOContext& loc,
                                     log_type def,
@@ -127,7 +127,7 @@ asio::awaitable<log_type> handle_dne(const DoutPrefixProvider *dpp,
 
 asio::awaitable<log_type>
 log_backing_type(const DoutPrefixProvider* dpp,
-                neorados::RADOS& rados,
+                neorados::RADOS rados,
                  const neorados::IOContext& loc,
                 log_type def,
                 int shards,
@@ -167,7 +167,7 @@ log_backing_type(const DoutPrefixProvider* dpp,
 
 asio::awaitable<void> log_remove(
   const DoutPrefixProvider *dpp,
-  neorados::RADOS& rados,
+  neorados::RADOS rados,
   const neorados::IOContext& loc,
   int shards,
   const fu2::unique_function<std::string(int) const>& get_oid,
@@ -224,16 +224,26 @@ asio::awaitable<void> log_remove(
   co_return;
 }
 
-logback_generations::~logback_generations() {
+void logback_generations::shutdown() {
   if (watchcookie > 0) {
     auto cct = rados.cct();
     sys::error_code ec;
-    rados.unwatch(watchcookie, loc, asio::detached);
+    rados.unwatch(watchcookie, loc, async::use_blocked[ec]);
     if (ec) {
       lderr(cct) << __PRETTY_FUNCTION__ << ":" << __LINE__
                 << ": failed unwatching oid=" << oid
                 << ", " << ec.message() << dendl;
     }
+    watchcookie = 0;
+  }
+}
+
+
+logback_generations::~logback_generations() {
+  auto cct = rados.cct();
+  if (watchcookie > 0) {
+    lderr(cct) << __PRETTY_FUNCTION__ << ":" << __LINE__
+              << ": logback_generations destroyed without shutdown." << dendl;
   }
 }
 
index 7d5ffee150e91ae5a5f32268415858ef32c8abef..04360f9d80ad78003381eb0599e9d9736d18417e 100644 (file)
@@ -74,7 +74,7 @@ inline std::ostream& operator <<(std::ostream& m, const log_type& t) {
 /// Look over the shards in a log and determine the type.
 asio::awaitable<log_type>
 log_backing_type(const DoutPrefixProvider* dpp,
-                neorados::RADOS& rados,
+                neorados::RADOS rados,
                  const neorados::IOContext& loc,
                 log_type def,
                 int shards,
@@ -83,7 +83,7 @@ log_backing_type(const DoutPrefixProvider* dpp,
 /// Remove all log shards and associated parts of fifos.
 asio::awaitable<void> log_remove(
   const DoutPrefixProvider *dpp,
-  neorados::RADOS& rados,
+  neorados::RADOS rados,
   const neorados::IOContext& loc,
   int shards,
   const fu2::unique_function<std::string(int) const>& get_oid,
@@ -121,10 +121,10 @@ public:
   using entries_t = container::flat_map<uint64_t, logback_generation>;
 
 protected:
-  neorados::RADOS& rados;
+  neorados::RADOS rados;
   neorados::IOContext loc;
   logback_generations(
-    neorados::RADOS& rados,
+    neorados::RADOS rados,
     neorados::Object oid,
     neorados::IOContext loc,
     fu2::unique_function<std::string(uint64_t, int) const> get_oid,
@@ -183,7 +183,7 @@ public:
   template<typename T, typename... Args>
   static asio::awaitable<std::unique_ptr<T>> init(
     const DoutPrefixProvider *dpp,
-    neorados::RADOS& r_,
+    neorados::RADOS r_,
     const neorados::Object& oid_,
     const neorados::IOContext& loc_,
     fu2::unique_function<std::string(uint64_t, int) const>&& get_oid_,
@@ -225,6 +225,9 @@ public:
   ///
   /// @param new_tail Lowest non-empty generation
   virtual void handle_empty_to(uint64_t new_tail) = 0;
+
+  /// If you override this, call the superclass method *at the end*.
+  virtual void shutdown();
 };
 
 inline std::string gencursor(uint64_t gen_id, std::string_view cursor) {
@@ -252,7 +255,7 @@ cursorgen(std::optional<std::string> cursor_) {
 }
 
 class LazyFIFO {
-  neorados::RADOS& r;
+  neorados::RADOS r;
   const std::string oid;
   const neorados::IOContext loc;
   std::mutex m;
@@ -299,7 +302,7 @@ class LazyFIFO {
 
 public:
 
-  LazyFIFO(neorados::RADOS& r,  std::string oid, neorados::IOContext loc)
+  LazyFIFO(neorados::RADOS r,  std::string oid, neorados::IOContext loc)
     : r(r), oid(std::move(oid)), loc(std::move(loc)) {}
 
   asio::awaitable<void> push(const DoutPrefixProvider *dpp,
index 2221d30f7efbc0fe9703e8f09994b85d23575c49..5c19e9223a716a99be7068fddcf8d7830d016bcd 100644 (file)
@@ -2268,25 +2268,12 @@ int RadosStore::get_raw_chunk_size(const DoutPrefixProvider* dpp, const rgw_raw_
   return rados->get_max_chunk_size(obj.pool, chunk_size, dpp);
 }
 
-int RadosStore::init_neorados(const DoutPrefixProvider* dpp) {
-  if (!neorados) try {
-      neorados = neorados::RADOS::make_with_cct(dpp->get_cct(), io_context,
-                                               ceph::async::use_blocked);
-    } catch (const boost::system::system_error& e) {
-      ldpp_dout(dpp, 0) << "ERROR: creating neorados handle failed: "
-                       << e.what() << dendl;
-      return ceph::from_error_code(e.code());
-    }
-  return 0;
-}
-
 int RadosStore::initialize(CephContext *cct, const DoutPrefixProvider *dpp)
 {
   std::unique_ptr<ZoneGroup> zg =
     std::make_unique<RadosZoneGroup>(this, svc()->zone->get_zonegroup());
   zone = make_unique<RadosZone>(this, std::move(zg));
-
-  return init_neorados(dpp);
+  return 0;
 }
 
 int RadosStore::log_usage(const DoutPrefixProvider *dpp, map<rgw_user_bucket, RGWUsageBatch>& usage_info, optional_yield y)
@@ -5483,20 +5470,17 @@ int RadosRole::delete_obj(const DoutPrefixProvider *dpp, optional_yield y)
 
 extern "C" {
 
-  void* newRadosStore(void* io_context, void* dpp_)
+void* newRadosStore(void* io_context_, CephContext* cct)
 {
-  auto dpp = static_cast<DoutPrefixProvider*>(dpp_);
-  rgw::sal::RadosStore* store = new rgw::sal::RadosStore(
-    *static_cast<boost::asio::io_context*>(io_context));
+  auto& io_context = *static_cast<boost::asio::io_context*>(io_context_);
+  ceph_assert(!io_context.stopped());
+  auto neorados = make_neorados(cct, io_context);
+  if (!neorados || !*neorados) {
+    return nullptr;
+  }
+  rgw::sal::RadosStore* store = nullptr;
+    store = new rgw::sal::RadosStore(*neorados);
   if (store) {
-    int ret = store->init_neorados(dpp);
-    if (ret < 0) {
-      ldpp_dout(dpp, 0) << "ERROR: failed to initialize neorados (ret=" << cpp_strerror(-ret) << ")" << dendl;
-      delete store;
-      store = nullptr;
-      return store;
-    }
-
     RGWRados* rados = new RGWRados();
 
     if (!rados) {
@@ -5509,5 +5493,4 @@ extern "C" {
 
   return store;
 }
-
 }
index 92bb1547493c21abf19c6516878e7018a5a79345..6f2bdbc3393e6af90e6fc4101a6ed3622fb0908a 100644 (file)
@@ -120,22 +120,21 @@ class RadosZone : public StoreZone {
 
 class RadosStore : public StoreDriver {
   private:
-    boost::asio::io_context& io_context;
+    neorados::RADOS neorados;
     RGWRados* rados;
     RGWUserCtl* user_ctl;
     std::unique_ptr<RadosZone> zone;
-    std::optional<neorados::RADOS> neorados;
     std::string topics_oid(const std::string& tenant) const;
 
   public:
-    RadosStore(boost::asio::io_context& io_context)
-      : io_context(io_context), rados(nullptr) {
-      }
+    RadosStore(neorados::RADOS neorados)
+      : neorados(neorados), rados(nullptr) {
+      ceph_assert(neorados);
+    }
     ~RadosStore() {
       delete rados;
     }
 
-    int init_neorados(const DoutPrefixProvider* dpp);
     virtual int initialize(CephContext *cct, const DoutPrefixProvider *dpp) override;
     virtual const std::string get_name() const override {
       return "rados";
@@ -446,8 +445,8 @@ class RadosStore : public StoreDriver {
 
     void setRados(RGWRados * st) { rados = st; }
     RGWRados* getRados(void) { return rados; }
-    boost::asio::io_context& get_io_context() { return io_context; }
-    neorados::RADOS& get_neorados() { return *neorados; }
+    boost::asio::io_context& get_io_context() { return neorados.get_io_context(); }
+    neorados::RADOS& get_neorados() { return neorados; }
 
     RGWServices* svc() { return &rados->svc; }
     const RGWServices* svc() const { return &rados->svc; }
index 23d1473badca712c90cadc549ee82a064e1afde5..e0d318cfe6dbb951d3d580064fef430d66fc6d29 100644 (file)
@@ -64,7 +64,7 @@ int RGWServices_Def::init(CephContext *cct,
   bilog_rados = std::make_unique<RGWSI_BILog_RADOS>(cct);
   cls = std::make_unique<RGWSI_Cls>(cct);
   config_key_rados = std::make_unique<RGWSI_ConfigKey_RADOS>(cct);
-  datalog_rados = std::make_shared<RGWDataChangesLog>(driver);
+  datalog_rados = std::make_unique<RGWDataChangesLog>(driver);
   mdlog = std::make_unique<RGWSI_MDLog>(cct, run_sync, cfgstore);
   notify = std::make_unique<RGWSI_Notify>(cct);
   zone = std::make_unique<RGWSI_Zone>(cct, cfgstore, site);
index 06643cae543fbbde5ecc7cb5cd9ce1dd98272718..e4d3df4f911051bb012878b1a8b157c42060ae5e 100644 (file)
@@ -101,7 +101,7 @@ struct RGWServices_Def
   std::unique_ptr<RGWSI_SysObj_Core> sysobj_core;
   std::unique_ptr<RGWSI_SysObj_Cache> sysobj_cache;
   std::unique_ptr<RGWSI_User_RADOS> user_rados;
-  std::shared_ptr<RGWDataChangesLog> datalog_rados;
+  std::unique_ptr<RGWDataChangesLog> datalog_rados;
   std::unique_ptr<RGWAsyncRadosProcessor> async_processor;
 
   RGWServices_Def();
index d3f616d252422247660b9716ed6fb3d21f89658f..03d215abed17d72e9f7c2d45dfc1493585c8fca5 100644 (file)
@@ -589,7 +589,7 @@ void rgw::AppMain::init_lua()
 #ifdef WITH_RADOSGW_RADOS
   if (driver->get_name() == "rados") { /* Supported for only RadosStore */
     lua_background = std::make_unique<
-      rgw::lua::Background>(driver, dpp->get_cct(), env.lua.manager.get());
+      rgw::lua::Background>(dpp->get_cct(), env.lua.manager.get());
     lua_background->start();
     env.lua.background = lua_background.get();
     static_cast<rgw::sal::RadosLuaManager*>(env.lua.manager.get())->watch_reload(dpp);
index 1772658b3bf2387b636ee3b246fbf189ebad9fc5..41a11c14d0a942b4909b47e6bb695ba21d1f21c1 100644 (file)
@@ -56,7 +56,7 @@ int RGWTable::increment_by(lua_State* L) {
   return 0;
 }
 
-Background::Background(rgw::sal::Driver* _driver,
+Background::Background(
     CephContext* _cct,
     rgw::sal::LuaManager* _lua_manager,
     int _execute_interval) :
@@ -93,7 +93,7 @@ void Background::pause() {
   cond.notify_all();
 }
 
-void Background::resume(rgw::sal::Driver* driver) {
+void Background::resume(rgw::sal::Driver*) {
   paused = false;
   cond.notify_all();
 }
index f06ca491eb2b389b5abad5d101d5c9e1c7e05791..8745b7f39121a0311fbedf1b4fdc96b54726209a 100644 (file)
@@ -158,10 +158,9 @@ private:
   std::unique_ptr<lua_state_guard> initialize_lguard_state();
 
  public:
-  Background(rgw::sal::Driver* _driver,
-      CephContext* _cct,
-      rgw::sal::LuaManager* _lua_manager,
-      int _execute_interval = INIT_EXECUTE_INTERVAL);
+  Background(CephContext* _cct,
+             rgw::sal::LuaManager* _lua_manager,
+             int _execute_interval = INIT_EXECUTE_INTERVAL);
 
   ~Background() override = default;
   void start();
@@ -177,7 +176,8 @@ private:
   // update the manager after 
   void set_manager(rgw::sal::LuaManager* _lua_manager);
   void pause() override;
-  void resume(rgw::sal::Driver* _driver) override;
+  // Does not actually use `Driver` argument.
+  void resume(rgw::sal::Driver*) override;
 };
 
 } //namespace rgw::lua
index 8d7f7281b96c1f9af99e3761eef15f92a632b46b..f4726bb0db166ad1434b3dac99d0cf9d7b5f2446 100644 (file)
@@ -782,7 +782,6 @@ void create_top_metatable(lua_State* L, req_state* s, const char* op_name) {
 }
 
 int execute(
-    rgw::sal::Driver* driver,
     RGWREST* rest,
     OpsLogSink* olog,
     req_state* s, 
index 7c85ac9cd984ff34628992a14ab46ccf4ffd44cb..911c660f2c6afd7141568313ec90bdc40e7cfcd9 100644 (file)
@@ -8,6 +8,7 @@ struct lua_State;
 class req_state;
 class RGWREST;
 class OpsLogSink;
+class RGWOp;
 
 namespace rgw::lua::request {
 
@@ -16,7 +17,6 @@ void create_top_metatable(lua_State* L, req_state* s, const char* op_name);
 
 // execute a lua script in the Request context
 int execute(
-    rgw::sal::Driver* driver,
     RGWREST* rest,
     OpsLogSink* olog,
     req_state *s, 
index 41ca7ad2c437d8af2732f14f0c8cf92a23f08cfd..52e1b8f2d1de1d590a0524e4199581b16221ebaf 100644 (file)
@@ -884,8 +884,7 @@ static void rgw_add_grant_to_iam_environment(rgw::IAM::Environment& e, req_state
   }
 }
 
-void rgw_build_iam_environment(rgw::sal::Driver* driver,
-                                     req_state* s)
+void rgw_build_iam_environment(req_state* s)
 {
   const auto& m = s->info.env->get_map();
   auto t = ceph::real_clock::now();
@@ -8655,7 +8654,7 @@ int RGWHandler::do_init_permissions(const DoutPrefixProvider *dpp, optional_yiel
     return ret==-ENODATA ? -EACCES : ret;
   }
 
-  rgw_build_iam_environment(driver, s);
+  rgw_build_iam_environment(s);
   return ret;
 }
 
index 35d7fb637eed6afff32d6b56229e96e3b136bf57..ed3b79a821e48df29c5dd0e435cecfe22824a3df 100644 (file)
@@ -2234,8 +2234,7 @@ extern int rgw_build_bucket_policies(const DoutPrefixProvider *dpp, rgw::sal::Dr
                                     req_state* s, optional_yield y);
 extern int rgw_build_object_policies(const DoutPrefixProvider *dpp, rgw::sal::Driver* driver,
                                     req_state *s, bool prefetch_data, optional_yield y);
-extern void rgw_build_iam_environment(rgw::sal::Driver* driver,
-                                     req_state* s);
+extern void rgw_build_iam_environment(req_state* s);
 
 inline int get_system_versioning_params(req_state *s,
                                        uint64_t *olh_epoch,
index c0c34cebb66d22eb6335a6e3fc27f6a1af0d9f3e..d23e9ba3886c0f7925532112e4ed71ef763b4bef 100644 (file)
@@ -344,8 +344,7 @@ int process_request(const RGWProcessEnv& penv,
           "WARNING: failed to execute pre request script. "
           "error: " << rc << dendl;
       } else {
-        rc = rgw::lua::request::execute(driver, rest, penv.olog.get(), s, op,
-                                        script);
+        rc = rgw::lua::request::execute(rest, penv.olog.get(), s, op, script);
         if (rc < 0) {
           ldpp_dout(op, 5) <<
             "WARNING: failed to execute pre request script. "
@@ -443,8 +442,7 @@ done:
           "WARNING: failed to read post request script. "
           "error: " << rc << dendl;
       } else {
-        rc = rgw::lua::request::execute(driver, rest, penv.olog.get(), s, op,
-                                        script);
+        rc = rgw::lua::request::execute(rest, penv.olog.get(), s, op, script);
         if (rc < 0) {
           ldpp_dout(op, 5) <<
             "WARNING: failed to execute post request script. "
index 07eff0d7b974097b9f9777cf128750019eeb91e2..201008c733d6d80cb36e6f6d9b78fa283993c10d 100644 (file)
@@ -5,6 +5,8 @@
 
 #include <memory>
 
+#include "rgw_auth_registry.h"
+
 class ActiveRateLimiter;
 class OpsLogSink;
 class RGWREST;
index 4c1c70d9e017bc8e955ddbe99f2d659e8837b354..4a6a2e6c576657f14a17d1ac8bdc64e7892d1c26 100644 (file)
@@ -1885,7 +1885,7 @@ static http_op op_from_method(const char *method)
 int RGWHandler_REST::init_permissions(RGWOp* op, optional_yield y)
 {
   if (op->get_type() == RGW_OP_CREATE_BUCKET) {
-    rgw_build_iam_environment(driver, s);
+    rgw_build_iam_environment(s);
     return 0;
   }
 
index 5e7e20a796bf9f65fa82129d85eebab9219da84f..c50033ad0172636f32247953180dc47a1e7b7348 100644 (file)
  *
  */
 
+#include <optional>
+
 #include <errno.h>
 #include <stdlib.h>
-#include <system_error>
 #include <unistd.h>
-#include <sstream>
 
 #include "common/errno.h"
 //#include "common/dout.h"
 
+#include "common/async/blocked_completion.h"
+
 #include "rgw_sal.h"
 #include "rgw_sal_rados.h"
 #include "driver/rados/config/store.h"
@@ -49,7 +51,7 @@
 
 extern "C" {
 #ifdef WITH_RADOSGW_RADOS
-extern rgw::sal::Driver* newRadosStore(void* io_context, const void* dpp);
+extern rgw::sal::Driver* newRadosStore(void* io_context, CephContext* cct);
 #endif
 #ifdef WITH_RADOSGW_DBSTORE
 extern rgw::sal::Driver* newDBStore(CephContext *cct);
@@ -69,6 +71,22 @@ extern rgw::sal::Driver* newD4NFilter(rgw::sal::Driver* next, boost::asio::io_co
 #endif
 }
 
+
+#ifdef WITH_RADOSGW_RADOS
+std::optional<neorados::RADOS>
+make_neorados(CephContext* cct, boost::asio::io_context& io_context) {
+  try {
+    auto neorados = neorados::RADOS::make_with_cct(cct, io_context,
+                                                  ceph::async::use_blocked);
+    return neorados;
+  } catch (const std::exception& e) {
+    ldout(cct, 0) << "Failed constructing neroados handle: " << e.what()
+                 << dendl;
+  }
+  return std::nullopt;
+}
+#endif
+
 rgw::sal::Driver* DriverManager::init_storage_provider(const DoutPrefixProvider* dpp,
                                                     CephContext* cct,
                                                     const Config& cfg,
@@ -90,7 +108,7 @@ rgw::sal::Driver* DriverManager::init_storage_provider(const DoutPrefixProvider*
 
   if (cfg.store_name.compare("rados") == 0) {
 #ifdef WITH_RADOSGW_RADOS
-    driver = newRadosStore(&io_context, dpp);
+    driver = newRadosStore(&io_context, cct);
     RGWRados* rados = static_cast<rgw::sal::RadosStore* >(driver)->getRados();
 
     if ((*rados).set_use_cache(use_cache)
@@ -119,7 +137,11 @@ rgw::sal::Driver* DriverManager::init_storage_provider(const DoutPrefixProvider*
   }
 #ifdef WITH_RADOSGW_RADOS
   else if (cfg.store_name.compare("d3n") == 0) {
-    driver = new rgw::sal::RadosStore(io_context);
+    auto neorados = make_neorados(cct, io_context);
+    if (!neorados) {
+      return nullptr;
+    }
+    driver = new rgw::sal::RadosStore(*neorados);
     RGWRados* rados = new D3nRGWDataCache<RGWRados>;
     dynamic_cast<rgw::sal::RadosStore*>(driver)->setRados(rados);
     rados->set_store(static_cast<rgw::sal::RadosStore* >(driver));
@@ -248,7 +270,7 @@ rgw::sal::Driver* DriverManager::init_raw_storage_provider(const DoutPrefixProvi
   rgw::sal::Driver* driver = nullptr;
   if (cfg.store_name.compare("rados") == 0) {
 #ifdef WITH_RADOSGW_RADOS
-    driver = newRadosStore(&io_context, dpp);
+    driver = newRadosStore(&io_context, cct);
     RGWRados* rados = static_cast<rgw::sal::RadosStore* >(driver)->getRados();
 
     rados->set_context(cct);
index 3f25a774137891123a33cac415e1fa25e2ae6228..1fc707efd878b162dc522131a1c0e80f201145df 100644 (file)
@@ -2009,4 +2009,9 @@ public:
 
 };
 
+#ifdef WITH_RADOSGW_RADOS
+std::optional<neorados::RADOS>
+make_neorados(CephContext* cct, boost::asio::io_context& io_context);
+#endif
+
 /** @} */
index a125019c269605349315c888b629a73b1bd30788..0400fed85b4d86ae75caeb7cc5e34738bb43ce08 100644 (file)
@@ -60,12 +60,12 @@ private:
                                boost::asio::use_awaitable);
   }
 
-  virtual asio::awaitable<std::shared_ptr<RGWDataChangesLog>>
+  virtual asio::awaitable<std::unique_ptr<RGWDataChangesLog>>
   create_datalog() = 0;
 
 protected:
 
-  std::shared_ptr<RGWDataChangesLog> datalog;
+  std::unique_ptr<RGWDataChangesLog> datalog;
 
   neorados::RADOS& rados() noexcept { return *rados_; }
   const std::string& pool_name() const noexcept { return pool_name_; }
@@ -170,7 +170,7 @@ protected:
   }
 
   auto recover(const DoutPrefixProvider* dpp) {
-    return datalog->recover(dpp, datalog->shared_from_this());
+    return datalog->recover(dpp);
   }
 
   void add_to_cur_cycle(const BucketGen& bg) {
@@ -199,7 +199,7 @@ public:
 
   /// \brief Delete pool used for testing
   boost::asio::awaitable<void> CoTearDown() override {
-    co_await datalog->shutdown();
+    co_await datalog->async_shutdown();
     co_await clean_pool();
     co_return;
   }
@@ -207,8 +207,8 @@ public:
 
 class DataLogTest : public DataLogTestBase {
 private:
-  asio::awaitable<std::shared_ptr<RGWDataChangesLog>> create_datalog() override {
-    auto datalog = std::make_shared<RGWDataChangesLog>(rados().cct(), true,
+  asio::awaitable<std::unique_ptr<RGWDataChangesLog>> create_datalog() override {
+    auto datalog = std::make_unique<RGWDataChangesLog>(rados().cct(), true,
                                                       rados());
     co_await datalog->start(dpp(), rgw_pool(pool_name()), false, true, false);
     co_return std::move(datalog);
@@ -217,8 +217,8 @@ private:
 
 class DataLogWatchless : public DataLogTestBase {
 private:
-  asio::awaitable<std::shared_ptr<RGWDataChangesLog>> create_datalog() override {
-    auto datalog = std::make_shared<RGWDataChangesLog>(rados().cct(), true,
+  asio::awaitable<std::unique_ptr<RGWDataChangesLog>> create_datalog() override {
+    auto datalog = std::make_unique<RGWDataChangesLog>(rados().cct(), true,
                                                       rados());
     co_await datalog->start(dpp(), rgw_pool(pool_name()), false, false, false);
     co_return std::move(datalog);
@@ -227,10 +227,10 @@ private:
 
 class DataLogBulky : public DataLogTestBase {
 private:
-  asio::awaitable<std::shared_ptr<RGWDataChangesLog>> create_datalog() override {
+  asio::awaitable<std::unique_ptr<RGWDataChangesLog>> create_datalog() override {
     // Decrease max push/list and force everything into one shard so we
     // can test iterated increment/decrement/list code.
-    auto datalog = std::make_shared<RGWDataChangesLog>(rados().cct(), true,
+    auto datalog = std::make_unique<RGWDataChangesLog>(rados().cct(), true,
                                                       rados(), 1, 7);
     co_await datalog->start(dpp(), rgw_pool(pool_name()), false, true, false);
     co_return std::move(datalog);
index 7bc221dcd1180593dde6a5128eacee557ff61cd5..f90d70c8cc18931d0804b32967478f2a0dc43999 100644 (file)
 
 #include <gtest/gtest.h>
 
+#include "rgw_sal_store.h"
+
 #include "include/stringify.h"
-#include "common/async/context_pool.h"
-#include "common/code_environment.h"
 #include "common/ceph_context.h"
-#include "global/global_init.h"
 #include "rgw_auth.h"
-#include "rgw_auth_registry.h"
 #include "rgw_iam_managed_policy.h"
 #include "rgw_op.h"
 #include "rgw_process_env.h"
-#include "rgw_sal_rados.h"
-#include "rgw_zone.h"
 #include "rgw_sal_config.h"
 
 using std::string;
@@ -1119,18 +1115,56 @@ TEST_F(IPPolicyTest, asNetworkInvalid) {
   EXPECT_FALSE(rgw::IAM::Condition::as_network("1.2.3.10000"));
 }
 
+class DumbUser : public rgw::sal::StoreUser {
+  using StoreUser::StoreUser;
+  std::unique_ptr<User> clone() {
+    return std::make_unique<DumbUser>(*this);
+  }
+  int read_attrs(const DoutPrefixProvider*, optional_yield) {
+    return -ENOTSUP;
+  }
+  int merge_and_store_attrs(const DoutPrefixProvider*, rgw::sal::Attrs&,
+                           optional_yield) {
+    return -ENOTSUP;
+  }
+  int read_usage(const DoutPrefixProvider*, uint64_t, uint64_t, uint32_t,
+                bool*, RGWUsageIter&,
+                std::map<rgw_user_bucket, rgw_usage_log_entry>&) {
+    return -ENOTSUP;
+  }
+  virtual int trim_usage(const DoutPrefixProvider*, uint64_t,
+                        uint64_t, optional_yield) {
+    return -ENOTSUP;
+  }
+  int load_user(const DoutPrefixProvider* dpp, optional_yield y) {
+    return -ENOTSUP;
+  }
+  int store_user(const DoutPrefixProvider*, optional_yield, bool, RGWUserInfo*) {
+    return -ENOTSUP;
+  }
+  int remove_user(const DoutPrefixProvider*, optional_yield) {
+    return -ENOTSUP;
+  }
+  int verify_mfa(const std::string&, bool*, const DoutPrefixProvider*,
+                optional_yield) {
+    return -ENOTSUP;
+  }
+  int list_groups(const DoutPrefixProvider*, optional_yield,
+                 std::string_view, uint32_t, rgw::sal::GroupList&) {
+    return -ENOTSUP;
+  }
+};
+
 TEST_F(IPPolicyTest, IPEnvironment) {
   RGWProcessEnv penv;
   // Unfortunately RGWCivetWeb is too tightly tied to civetweb to test RGWCivetWeb::init_env.
   RGWEnv rgw_env;
-  ceph::async::io_context_pool context_pool(cct->_conf->rgw_thread_pool_size); \
-  rgw::sal::RadosStore store(context_pool);
-  std::unique_ptr<rgw::sal::User> user = store.get_user(rgw_user());
+  std::unique_ptr<rgw::sal::User> user = std::make_unique<DumbUser>(rgw_user());
   rgw_env.set("REMOTE_ADDR", "192.168.1.1");
   rgw_env.set("HTTP_HOST", "1.2.3.4");
   req_state rgw_req_state(cct.get(), penv, &rgw_env, 0);
   rgw_req_state.set_user(user);
-  rgw_build_iam_environment(&store, &rgw_req_state);
+  rgw_build_iam_environment(&rgw_req_state);
   auto ip = rgw_req_state.env.find("aws:SourceIp");
   ASSERT_NE(ip, rgw_req_state.env.end());
   EXPECT_EQ(ip->second, "192.168.1.1");
@@ -1138,13 +1172,13 @@ TEST_F(IPPolicyTest, IPEnvironment) {
   ASSERT_EQ(cct.get()->_conf.set_val("rgw_remote_addr_param", "SOME_VAR"), 0);
   EXPECT_EQ(cct.get()->_conf->rgw_remote_addr_param, "SOME_VAR");
   rgw_req_state.env.clear();
-  rgw_build_iam_environment(&store, &rgw_req_state);
+  rgw_build_iam_environment(&rgw_req_state);
   ip = rgw_req_state.env.find("aws:SourceIp");
   EXPECT_EQ(ip, rgw_req_state.env.end());
 
   rgw_env.set("SOME_VAR", "192.168.1.2");
   rgw_req_state.env.clear();
-  rgw_build_iam_environment(&store, &rgw_req_state);
+  rgw_build_iam_environment(&rgw_req_state);
   ip = rgw_req_state.env.find("aws:SourceIp");
   ASSERT_NE(ip, rgw_req_state.env.end());
   EXPECT_EQ(ip->second, "192.168.1.2");
@@ -1152,14 +1186,14 @@ TEST_F(IPPolicyTest, IPEnvironment) {
   ASSERT_EQ(cct.get()->_conf.set_val("rgw_remote_addr_param", "HTTP_X_FORWARDED_FOR"), 0);
   rgw_env.set("HTTP_X_FORWARDED_FOR", "192.168.1.3");
   rgw_req_state.env.clear();
-  rgw_build_iam_environment(&store, &rgw_req_state);
+  rgw_build_iam_environment(&rgw_req_state);
   ip = rgw_req_state.env.find("aws:SourceIp");
   ASSERT_NE(ip, rgw_req_state.env.end());
   EXPECT_EQ(ip->second, "192.168.1.3");
 
   rgw_env.set("HTTP_X_FORWARDED_FOR", "192.168.1.4, 4.3.2.1, 2001:db8:85a3:8d3:1319:8a2e:370:7348");
   rgw_req_state.env.clear();
-  rgw_build_iam_environment(&store, &rgw_req_state);
+  rgw_build_iam_environment(&rgw_req_state);
   ip = rgw_req_state.env.find("aws:SourceIp");
   ASSERT_NE(ip, rgw_req_state.env.end());
   EXPECT_EQ(ip->second, "192.168.1.4");
index c057c341153c1f74cf6f1ff59624834c0a7645aa..625db9c8436c13a4d48322948d4f026f8e722e71 100644 (file)
@@ -1,8 +1,5 @@
 #include <gtest/gtest.h>
-#include "common/async/context_pool.h"
-#include "common/ceph_context.h"
 #include "rgw_common.h"
-#include "rgw_auth_registry.h"
 #include "rgw_process_env.h"
 #include "rgw_sal_rados.h"
 #include "rgw_lua_request.h"
@@ -160,22 +157,6 @@ public:
 
 tracing::Tracer tracer;
 
-inline std::unique_ptr<sal::RadosStore> make_store() {
-  auto context_pool = std::make_unique<ceph::async::io_context_pool>(
-    g_ceph_context->_conf->rgw_thread_pool_size);
-
-  struct StoreBundle : public sal::RadosStore {
-    std::unique_ptr<ceph::async::io_context_pool> context_pool;
-    StoreBundle(std::unique_ptr<ceph::async::io_context_pool> context_pool_)
-      : sal::RadosStore(*context_pool_.get()),
-        context_pool(std::move(context_pool_)) {
-      setRados(new RGWRados);
-    }
-    virtual ~StoreBundle() = default;
-  };
-  return std::make_unique<StoreBundle>(std::move(context_pool));
-};
-
 class TestLuaManager : public rgw::sal::StoreLuaManager {
   public:
     std::string lua_script;
@@ -219,7 +200,6 @@ void set_read_time(rgw::sal::LuaManager* manager, unsigned read_time) {
 }
 
 #define DEFINE_REQ_STATE RGWProcessEnv pe; \
-  auto store = make_store();                   \
   pe.lua.manager = std::make_unique<TestLuaManager>(); \
   RGWEnv e; \
   req_state s(g_ceph_context, pe, &e, 0);
@@ -233,7 +213,7 @@ TEST(TestRGWLua, EmptyScript)
 
   DEFINE_REQ_STATE;
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, 0);
 }
 
@@ -246,7 +226,7 @@ TEST(TestRGWLua, SyntaxError)
 
   DEFINE_REQ_STATE;
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, -1);
 }
 
@@ -258,7 +238,7 @@ TEST(TestRGWLua, Hello)
 
   DEFINE_REQ_STATE;
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, 0);
 }
 
@@ -270,7 +250,7 @@ TEST(TestRGWLua, RGWDebugLogNumber)
 
   DEFINE_REQ_STATE;
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, 0);
 }
 
@@ -282,7 +262,7 @@ TEST(TestRGWLua, RGWDebugNil)
 
   DEFINE_REQ_STATE;
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, -1);
 }
 
@@ -296,7 +276,7 @@ TEST(TestRGWLua, URI)
   DEFINE_REQ_STATE;
   s.decoded_uri = "http://hello.world/";
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, 0);
 }
 
@@ -315,7 +295,7 @@ TEST(TestRGWLua, Response)
   s.err.err_code = "Bad Request";
   s.err.message = "This is a bad request";
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, 0);
 }
 
@@ -330,7 +310,7 @@ TEST(TestRGWLua, SetResponse)
   DEFINE_REQ_STATE;
   s.err.message = "this is a bad request";
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, 0);
 }
 
@@ -344,7 +324,7 @@ TEST(TestRGWLua, RGWIdNotWriteable)
   DEFINE_REQ_STATE;
   s.host_id = "foo";
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_NE(rc, 0);
 }
 
@@ -357,7 +337,7 @@ TEST(TestRGWLua, InvalidField)
   DEFINE_REQ_STATE;
   s.host_id = "foo";
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, -1);
 }
 
@@ -369,7 +349,7 @@ TEST(TestRGWLua, InvalidSubField)
 
   DEFINE_REQ_STATE;
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, -1);
 }
 
@@ -402,7 +382,7 @@ TEST(TestRGWLua, Bucket)
   info.owner = rgw_user{"mytenant", "myuser"};
   s.bucket.reset(new sal::RadosBucket(nullptr, info));
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, 0);
 }
 
@@ -417,7 +397,7 @@ TEST(TestRGWLua, WriteBucket)
   DEFINE_REQ_STATE;
   s.init_state.url_bucket = "myname";
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, 0);
   ASSERT_EQ(s.init_state.url_bucket, "othername");
 }
@@ -435,7 +415,7 @@ TEST(TestRGWLua, WriteBucketFail)
   b.name = "myname";
   s.bucket.reset(new sal::RadosBucket(nullptr, b));
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_NE(rc, 0);
 }
 
@@ -458,7 +438,7 @@ TEST(TestRGWLua, GenericAttributes)
   s.generic_attrs["goodbye"] = "cruel world";
   s.generic_attrs["ka"] = "boom";
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, 0);
 }
 
@@ -480,7 +460,7 @@ TEST(TestRGWLua, Environment)
   s.env.emplace("goodbye", "cruel world");
   s.env.emplace("ka", "boom");
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, 0);
 }
 
@@ -501,7 +481,7 @@ TEST(TestRGWLua, Tags)
   s.tagset.add_tag("goodbye", "cruel world");
   s.tagset.add_tag("ka", "boom");
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, 0);
 }
 
@@ -514,7 +494,7 @@ TEST(TestRGWLua, TagsNotWriteable)
   DEFINE_REQ_STATE;
   s.tagset.add_tag("hello", "world");
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_NE(rc, 0);
 }
 
@@ -540,7 +520,7 @@ TEST(TestRGWLua, Metadata)
   s.info.x_meta_map["foo"] = "bar";
   s.info.x_meta_map["ka"] = "boom";
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, 0);
 }
 
@@ -567,7 +547,7 @@ TEST(TestRGWLua, WriteMetadata)
   s.info.x_meta_map["foo"] = "bar";
   s.info.x_meta_map["ka"] = "boom";
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, 0);
 }
 
@@ -606,7 +586,7 @@ TEST(TestRGWLua, MetadataIterateWrite)
   s.info.x_meta_map["f"] = "6";
   s.info.x_meta_map["g"] = "7";
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, 0);
   ASSERT_EQ(s.info.x_meta_map.count("c"), 0);
 }
@@ -637,7 +617,7 @@ TEST(TestRGWLua, MetadataIterator)
     end
   )";
 
-  auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_NE(rc, 0);
   
   script = R"(
@@ -659,7 +639,7 @@ TEST(TestRGWLua, MetadataIterator)
     end
   )";
 
-  rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_NE(rc, 0);
   
   script = R"(
@@ -680,7 +660,7 @@ TEST(TestRGWLua, MetadataIterator)
     assert(counter == #Request.HTTP.Metadata)
   )";
 
-  rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, 0);
 }
 
@@ -740,7 +720,7 @@ TEST(TestRGWLua, Acl)
   s.user_acl.get_acl().add_grant(grant5);
   s.user_acl.get_acl().add_grant(grant6_1);
   s.user_acl.get_acl().add_grant(grant6_2);
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, 0);
 }
 
@@ -756,7 +736,7 @@ TEST(TestRGWLua, User)
 
   s.user.reset(new sal::RadosUser(nullptr, rgw_user("mytenant", "myid")));
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, 0);
 }
 
@@ -796,7 +776,7 @@ TEST(TestRGWLua, UseFunction)
   s.object_acl.get_owner().display_name = "user five";
   s.object_acl.get_owner().id = rgw_user("tenant5", "user5");
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, 0);
 }
 
@@ -817,7 +797,7 @@ TEST(TestRGWLua, WithLib)
   b.name = "my-bucket-name-is-fish";
   s.bucket.reset(new sal::RadosBucket(nullptr, b));
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, 0);
 }
 
@@ -830,7 +810,7 @@ TEST(TestRGWLua, NotAllowedInLib)
 
   DEFINE_REQ_STATE;
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_NE(rc, 0);
 }
 
@@ -873,20 +853,20 @@ TEST(TestRGWLua, OpsLog)
   s.auth.identity = std::unique_ptr<rgw::auth::Identity>(
                         new FakeIdentity());
 
-  auto rc = lua::request::execute(store.get(), nullptr, &olog, &s, nullptr, script);
+  auto rc = lua::request::execute(nullptr, &olog, &s, nullptr, script);
   EXPECT_EQ(rc, 0);
   EXPECT_FALSE(olog.logged); // don't log http_ret=200
  
        s.err.http_ret = 400;
-  rc = lua::request::execute(store.get(), nullptr, &olog, &s, nullptr, script);
+  rc = lua::request::execute(nullptr, &olog, &s, nullptr, script);
   EXPECT_EQ(rc, 0);
   EXPECT_TRUE(olog.logged);
 }
 
 class TestBackground : public rgw::lua::Background {
 public:
-  TestBackground(sal::RadosStore* store, rgw::sal::LuaManager* manager) : 
-    rgw::lua::Background(store, 
+  TestBackground(rgw::sal::LuaManager* manager) : 
+    rgw::lua::Background(
         g_ceph_context,
         manager,
         1 /* run every second */) {
@@ -899,15 +879,14 @@ public:
 
 TEST(TestRGWLuaBackground, Start)
 {
-  auto store = make_store();
   auto manager = std::make_unique<TestLuaManager>();
   {
     // ctr and dtor without running
-    TestBackground lua_background(store.get(), manager.get());
+    TestBackground lua_background(manager.get());
   }
   {
     // ctr and dtor with running
-    TestBackground lua_background(store.get(), manager.get());
+    TestBackground lua_background(manager.get());
     lua_background.start();
   }
 }
@@ -941,10 +920,9 @@ TEST(TestRGWLuaBackground, Script)
     RGW[key] = value
   )";
 
-  auto store = make_store();
   auto manager = std::make_unique<TestLuaManager>();
   set_script(manager.get(), script);
-  TestBackground lua_background(store.get(), manager.get());
+  TestBackground lua_background(manager.get());
   lua_background.start();
   WAIT_FOR_BACKGROUND;
   EXPECT_EQ(get_table_value<std::string>(lua_background, "hello"), "world");
@@ -960,7 +938,7 @@ TEST(TestRGWLuaBackground, RequestScript)
 
   DEFINE_REQ_STATE;
   set_script(pe.lua.manager.get(), background_script);
-  TestBackground lua_background(store.get(), pe.lua.manager.get());
+  TestBackground lua_background(pe.lua.manager.get());
   lua_background.start();
   WAIT_FOR_BACKGROUND;
 
@@ -975,12 +953,12 @@ TEST(TestRGWLuaBackground, RequestScript)
 
   // to make sure test is consistent we have to pause the background
   lua_background.pause();
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, request_script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, request_script);
   ASSERT_EQ(rc, 0);
   EXPECT_EQ(get_table_value<std::string>(lua_background, "hello"), "from request");
   // now we resume and let the background set the value
   perfcounter->set(l_rgw_lua_script_ok, 0);
-  lua_background.resume(store.get());
+  lua_background.resume(nullptr);
   WAIT_FOR_BACKGROUND;
   EXPECT_EQ(get_table_value<std::string>(lua_background, "hello"), "from background");
 }
@@ -997,10 +975,9 @@ TEST(TestRGWLuaBackground, Pause)
     end
   )";
 
-  auto store = make_store();
   auto manager = std::make_unique<TestLuaManager>();
   set_script(manager.get(), script);
-  TestBackground lua_background(store.get(), manager.get());
+  TestBackground lua_background(manager.get());
   lua_background.start();
   WAIT_FOR_BACKGROUND;
   const auto value_len = get_table_value<std::string>(lua_background, "hello").size();
@@ -1025,11 +1002,10 @@ TEST(TestRGWLuaBackground, PauseWhileReading)
     end
   )";
 
-  auto store = make_store();
   auto manager = std::make_unique<TestLuaManager>();
   set_script(manager.get(), script);
   set_read_time(manager.get(), 2);
-  TestBackground lua_background(store.get(), manager.get());
+  TestBackground lua_background(manager.get());
   lua_background.start();
   WAIT_FOR_BACKGROUND;
   const auto value_len = get_table_value<std::string>(lua_background, "hello").size();
@@ -1049,16 +1025,15 @@ TEST(TestRGWLuaBackground, ReadWhilePaused)
     RGW[key] = value
   )";
 
-  auto store = make_store();
   auto manager = std::make_unique<TestLuaManager>();
   set_script(manager.get(), script);
-  TestBackground lua_background(store.get(), manager.get());
+  TestBackground lua_background(manager.get());
   lua_background.pause();
   lua_background.start();
   // make sure no execution occurs
   std::this_thread::sleep_for(wait_time*10);
   EXPECT_EQ(get_table_value<std::string>(lua_background, "hello"), "");
-  lua_background.resume(store.get());
+  lua_background.resume(nullptr);
   WAIT_FOR_BACKGROUND;
   EXPECT_EQ(get_table_value<std::string>(lua_background, "hello"), "world");
 }
@@ -1075,10 +1050,9 @@ TEST(TestRGWLuaBackground, PauseResume)
     end
   )";
 
-  auto store = make_store();
   auto manager = std::make_unique<TestLuaManager>();
   set_script(manager.get(), script);
-  TestBackground lua_background(store.get(), manager.get());
+  TestBackground lua_background(manager.get());
   lua_background.start();
   WAIT_FOR_BACKGROUND;
   const auto value_len = get_table_value<std::string>(lua_background, "hello").size();
@@ -1089,7 +1063,7 @@ TEST(TestRGWLuaBackground, PauseResume)
   // no change in len
   EXPECT_EQ(value_len, get_table_value<std::string>(lua_background, "hello").size());
   perfcounter->set(l_rgw_lua_script_ok, 0);
-  lua_background.resume(store.get());
+  lua_background.resume(nullptr);
   WAIT_FOR_BACKGROUND;
   // should be a change in len
   EXPECT_GT(get_table_value<std::string>(lua_background, "hello").size(), value_len);
@@ -1107,10 +1081,9 @@ TEST(TestRGWLuaBackground, MultipleStarts)
     end
   )";
 
-  auto store = make_store();
   auto manager = std::make_unique<TestLuaManager>();
   set_script(manager.get(), script);
-  TestBackground lua_background(store.get(), manager.get());
+  TestBackground lua_background(manager.get());
   lua_background.start();
   WAIT_FOR_BACKGROUND;
   const auto value_len = get_table_value<std::string>(lua_background, "hello").size();
@@ -1128,7 +1101,7 @@ TEST(TestRGWLuaBackground, MultipleStarts)
 TEST(TestRGWLuaBackground, TableValues)
 {
   DEFINE_REQ_STATE;
-  TestBackground lua_background(store.get(), pe.lua.manager.get());
+  TestBackground lua_background(pe.lua.manager.get());
 
   const std::string request_script = R"(
     RGW["key1"] = "string value"
@@ -1139,7 +1112,7 @@ TEST(TestRGWLuaBackground, TableValues)
 
   pe.lua.background = &lua_background;
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, request_script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, request_script);
   ASSERT_EQ(rc, 0);
   EXPECT_EQ(get_table_value<std::string>(lua_background, "key1"), "string value");
   EXPECT_EQ(get_table_value<long long int>(lua_background, "key2"), 42);
@@ -1150,7 +1123,7 @@ TEST(TestRGWLuaBackground, TableValues)
 TEST(TestRGWLuaBackground, TablePersist)
 {
   DEFINE_REQ_STATE;
-  TestBackground lua_background(store.get(), pe.lua.manager.get());
+  TestBackground lua_background(pe.lua.manager.get());
 
   std::string request_script = R"(
     RGW["key1"] = "string value"
@@ -1159,7 +1132,7 @@ TEST(TestRGWLuaBackground, TablePersist)
 
   pe.lua.background = &lua_background;
 
-  auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, request_script);
+  auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, request_script);
   ASSERT_EQ(rc, 0);
   EXPECT_EQ(get_table_value<std::string>(lua_background, "key1"), "string value");
   EXPECT_EQ(get_table_value<long long int>(lua_background, "key2"), 42);
@@ -1169,7 +1142,7 @@ TEST(TestRGWLuaBackground, TablePersist)
     RGW["key4"] = RGW["key2"]
   )";
   
-  rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, request_script);
+  rc = lua::request::execute(nullptr, nullptr, &s, nullptr, request_script);
   ASSERT_EQ(rc, 0);
   EXPECT_EQ(get_table_value<std::string>(lua_background, "key1"), "string value");
   EXPECT_EQ(get_table_value<long long int>(lua_background, "key2"), 42);
@@ -1180,7 +1153,7 @@ TEST(TestRGWLuaBackground, TablePersist)
 TEST(TestRGWLuaBackground, TableValuesFromRequest)
 {
   DEFINE_REQ_STATE;
-  TestBackground lua_background(store.get(), pe.lua.manager.get());
+  TestBackground lua_background(pe.lua.manager.get());
   lua_background.start();
 
   const std::string request_script = R"(
@@ -1197,7 +1170,7 @@ TEST(TestRGWLuaBackground, TableValuesFromRequest)
   s.err.ret = -99;
   s.err.message = "hi";
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, request_script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, request_script);
   ASSERT_EQ(rc, 0);
   EXPECT_EQ(get_table_value<long long int>(lua_background, "key1"), -99);
   EXPECT_EQ(get_table_value<std::string>(lua_background, "key2"), "hi");
@@ -1208,7 +1181,7 @@ TEST(TestRGWLuaBackground, TableValuesFromRequest)
 TEST(TestRGWLuaBackground, TableInvalidValue)
 {
   DEFINE_REQ_STATE;
-  TestBackground lua_background(store.get(), pe.lua.manager.get());
+  TestBackground lua_background(pe.lua.manager.get());
   lua_background.start();
 
   const std::string request_script = R"(
@@ -1223,7 +1196,7 @@ TEST(TestRGWLuaBackground, TableInvalidValue)
   s.tagset.add_tag("key1", "val1");
   s.tagset.add_tag("key2", "val2");
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, request_script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, request_script);
   ASSERT_NE(rc, 0);
   EXPECT_EQ(get_table_value<std::string>(lua_background, "key1"), "val1");
   EXPECT_EQ(get_table_value<long long int>(lua_background, "key2"), 42);
@@ -1234,7 +1207,7 @@ TEST(TestRGWLuaBackground, TableInvalidValue)
 TEST(TestRGWLuaBackground, TableErase)
 {
   DEFINE_REQ_STATE;
-  TestBackground lua_background(store.get(), pe.lua.manager.get());
+  TestBackground lua_background(pe.lua.manager.get());
 
   std::string request_script = R"(
     RGW["size"] = 0
@@ -1246,7 +1219,7 @@ TEST(TestRGWLuaBackground, TableErase)
 
   pe.lua.background = &lua_background;
 
-  auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, request_script);
+  auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, request_script);
   ASSERT_EQ(rc, 0);
   EXPECT_EQ(get_table_value<std::string>(lua_background, "key1"), "string value");
   EXPECT_EQ(get_table_value<long long int>(lua_background, "key2"), 42);
@@ -1261,7 +1234,7 @@ TEST(TestRGWLuaBackground, TableErase)
     RGW["size"] = #RGW
   )";
   
-  rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, request_script);
+  rc = lua::request::execute(nullptr, nullptr, &s, nullptr, request_script);
   ASSERT_EQ(rc, 0);
   EXPECT_EQ(get_table_value<std::string>(lua_background, "key1"), "");
   EXPECT_EQ(get_table_value<long long int>(lua_background, "key2"), 42);
@@ -1272,7 +1245,7 @@ TEST(TestRGWLuaBackground, TableErase)
 TEST(TestRGWLuaBackground, TableIterate)
 {
   DEFINE_REQ_STATE;
-  TestBackground lua_background(store.get(), pe.lua.manager.get());
+  TestBackground lua_background(pe.lua.manager.get());
 
   const std::string request_script = R"(
     RGW["key1"] = "string value"
@@ -1287,7 +1260,7 @@ TEST(TestRGWLuaBackground, TableIterate)
 
   pe.lua.background = &lua_background;
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, request_script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, request_script);
   ASSERT_EQ(rc, 0);
   EXPECT_EQ(get_table_value<std::string>(lua_background, "key1"), "string value");
   EXPECT_EQ(get_table_value<long long int>(lua_background, "key2"), 42);
@@ -1299,7 +1272,7 @@ TEST(TestRGWLuaBackground, TableIterate)
 TEST(TestRGWLuaBackground, TableIterateWrite)
 {
   DEFINE_REQ_STATE;
-  TestBackground lua_background(store.get(), pe.lua.manager.get());
+  TestBackground lua_background(pe.lua.manager.get());
 
   const std::string request_script = R"(
     RGW["a"] = 1
@@ -1321,7 +1294,7 @@ TEST(TestRGWLuaBackground, TableIterateWrite)
 
   pe.lua.background = &lua_background;
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, request_script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, request_script);
   ASSERT_EQ(rc, 0);
   EXPECT_EQ(lua_background.get_table_value("c"), TestBackground::empty_table_value);
 }
@@ -1329,7 +1302,7 @@ TEST(TestRGWLuaBackground, TableIterateWrite)
 TEST(TestRGWLuaBackground, TableIncrement)
 {
   DEFINE_REQ_STATE;
-  TestBackground lua_background(store.get(), pe.lua.manager.get());
+  TestBackground lua_background(pe.lua.manager.get());
 
   const std::string request_script = R"(
     RGW["key1"] = 42
@@ -1342,14 +1315,14 @@ TEST(TestRGWLuaBackground, TableIncrement)
 
   pe.lua.background = &lua_background;
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, request_script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, request_script);
   ASSERT_EQ(rc, 0);
 }
 
 TEST(TestRGWLuaBackground, TableIncrementBy)
 {
   DEFINE_REQ_STATE;
-  TestBackground lua_background(store.get(), pe.lua.manager.get());
+  TestBackground lua_background(pe.lua.manager.get());
 
   const std::string request_script = R"(
     RGW["key1"] = 42
@@ -1364,14 +1337,14 @@ TEST(TestRGWLuaBackground, TableIncrementBy)
 
   pe.lua.background = &lua_background;
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, request_script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, request_script);
   ASSERT_EQ(rc, 0);
 }
 
 TEST(TestRGWLuaBackground, TableDecrement)
 {
   DEFINE_REQ_STATE;
-  TestBackground lua_background(store.get(), pe.lua.manager.get());
+  TestBackground lua_background(pe.lua.manager.get());
 
   const std::string request_script = R"(
     RGW["key1"] = 42
@@ -1384,14 +1357,14 @@ TEST(TestRGWLuaBackground, TableDecrement)
 
   pe.lua.background = &lua_background;
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, request_script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, request_script);
   ASSERT_EQ(rc, 0);
 }
 
 TEST(TestRGWLuaBackground, TableDecrementBy)
 {
   DEFINE_REQ_STATE;
-  TestBackground lua_background(store.get(), pe.lua.manager.get());
+  TestBackground lua_background(pe.lua.manager.get());
 
   const std::string request_script = R"(
     RGW["key1"] = 42
@@ -1406,14 +1379,14 @@ TEST(TestRGWLuaBackground, TableDecrementBy)
 
   pe.lua.background = &lua_background;
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, request_script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, request_script);
   ASSERT_EQ(rc, 0);
 }
 
 TEST(TestRGWLuaBackground, TableIncrementValueError)
 {
   DEFINE_REQ_STATE;
-  TestBackground lua_background(store.get(), pe.lua.manager.get());
+  TestBackground lua_background(pe.lua.manager.get());
 
   std::string request_script = R"(
     -- cannot increment string values
@@ -1423,7 +1396,7 @@ TEST(TestRGWLuaBackground, TableIncrementValueError)
 
   pe.lua.background = &lua_background;
 
-  auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, request_script);
+  auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, request_script);
   ASSERT_NE(rc, 0);
   
   request_script = R"(
@@ -1432,7 +1405,7 @@ TEST(TestRGWLuaBackground, TableIncrementValueError)
     RGW.increment("key1")
   )";
 
-  rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, request_script);
+  rc = lua::request::execute(nullptr, nullptr, &s, nullptr, request_script);
   ASSERT_NE(rc, 0);
   
   request_script = R"(
@@ -1441,14 +1414,14 @@ TEST(TestRGWLuaBackground, TableIncrementValueError)
     RGW.increment("key1", "kaboom")
   )";
 
-  rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, request_script);
+  rc = lua::request::execute(nullptr, nullptr, &s, nullptr, request_script);
   ASSERT_NE(rc, 0);
 }
 
 TEST(TestRGWLuaBackground, TableIncrementError)
 {
   DEFINE_REQ_STATE;
-  TestBackground lua_background(store.get(), pe.lua.manager.get());
+  TestBackground lua_background(pe.lua.manager.get());
 
   std::string request_script = R"(
     -- missing argument
@@ -1458,7 +1431,7 @@ TEST(TestRGWLuaBackground, TableIncrementError)
 
   pe.lua.background = &lua_background;
 
-  auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, request_script);
+  auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, request_script);
   ASSERT_NE(rc, 0);
   
   request_script = R"(
@@ -1466,7 +1439,7 @@ TEST(TestRGWLuaBackground, TableIncrementError)
     RGW.increment = 11
   )";
 
-  rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, request_script);
+  rc = lua::request::execute(nullptr, nullptr, &s, nullptr, request_script);
   ASSERT_NE(rc, 0);
 }
 
@@ -1480,7 +1453,7 @@ TEST(TestRGWLua, TracingSetAttribute)
 
   DEFINE_REQ_STATE;
   INIT_TRACE;
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, 0);
 }
 
@@ -1492,7 +1465,7 @@ TEST(TestRGWLua, TracingSetBadAttribute)
 
   DEFINE_REQ_STATE;
   INIT_TRACE;
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   #ifdef HAVE_JAEGER
    ASSERT_NE(rc, 0);
   #else
@@ -1514,7 +1487,7 @@ TEST(TestRGWLua, TracingAddEvent)
 
   DEFINE_REQ_STATE;
   INIT_TRACE;
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, 0);
 }
 
@@ -1537,7 +1510,7 @@ TEST(TestRGWLua, Data)
   )";
 
   DEFINE_REQ_STATE;
-  TestBackground lua_background(store.get(), pe.lua.manager.get());
+  TestBackground lua_background(pe.lua.manager.get());
   s.host_id = "foo";
   pe.lua.background = &lua_background;
   lua::RGWObjFilter filter(&s, script);
@@ -1574,22 +1547,22 @@ TEST(TestRGWLua, MemoryLimit)
   
   // memory should be sufficient
   s.cct->_conf->rgw_lua_max_memory_per_state = 1024*32;
-  auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, 0);
   
   // no memory limit
   s.cct->_conf->rgw_lua_max_memory_per_state = 0;
-  rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, 0);
   
   // not enough memory to start lua
   s.cct->_conf->rgw_lua_max_memory_per_state = 2048;
-  rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_NE(rc, 0);
 
   // not enough memory for initial setup
   s.cct->_conf->rgw_lua_max_memory_per_state = 1024*16;
-  rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_NE(rc, 0);
   
   // not enough memory for the script
@@ -1600,7 +1573,7 @@ TEST(TestRGWLua, MemoryLimit)
     end
   )";
   s.cct->_conf->rgw_lua_max_memory_per_state = 1024*32;
-  rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_NE(rc, 0);
 }
 
@@ -1612,12 +1585,12 @@ TEST(TestRGWLua, LuaRuntimeLimit)
 
   // runtime should be sufficient
   s.cct->_conf->rgw_lua_max_runtime_per_state = 1000; // 1 second runtime limit
-  int rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  int rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, 0);
 
   // no runtime limit
   s.cct->_conf->rgw_lua_max_runtime_per_state = 0;
-  rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, 0);
   
   // script should exceed the runtime limit
@@ -1629,11 +1602,11 @@ TEST(TestRGWLua, LuaRuntimeLimit)
   )";
  
   s.cct->_conf->rgw_lua_max_runtime_per_state = 10; // 10 milliseconds runtime limit
-  rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_NE(rc, 0);
 
   s.cct->_conf->rgw_lua_max_runtime_per_state = 0; // no runtime limit
-  rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, 0);
 
   // script should exceed the runtime limit
@@ -1644,7 +1617,7 @@ TEST(TestRGWLua, LuaRuntimeLimit)
   )";
  
   s.cct->_conf->rgw_lua_max_runtime_per_state = 5000; // 5 seconds runtime limit
-  rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_NE(rc, 0);
 }
 
@@ -1671,7 +1644,7 @@ TEST(TestRGWLua, DifferentContextUser)
   info.owner = rgw_user{"tenant2", "user2"};
   s.bucket.reset(new sal::RadosBucket(nullptr, info));
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, 0);
 }
 
@@ -1697,7 +1670,7 @@ TEST(TestRGWLua, NestedLoop)
   s.info.x_meta_map["33"] = "cc";
   s.info.x_meta_map["44"] = "dd";
 
-  const auto rc = lua::request::execute(nullptr, nullptr, nullptr, &s, nullptr, script);
+  const auto rc = lua::request::execute(nullptr, nullptr, &s, nullptr, script);
   ASSERT_EQ(rc, 0);
 }