From: yuval Lifshitz Date: Tue, 17 May 2022 13:51:32 +0000 (+0300) Subject: rgw/lua: don't create the script manager per request X-Git-Tag: v18.0.0~269^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a1e21d0886c5c3ce5e65819aa12cf807f51e2061;p=ceph.git rgw/lua: don't create the script manager per request Fixes: https://tracker.ceph.com/issues/53810 Signed-off-by: yuval Lifshitz --- diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index ee7c926ed7aa..95b8e40453a2 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -10394,7 +10394,8 @@ next: cerr << "ERROR: cannot specify tenant in background context" << std::endl; return EINVAL; } - rc = rgw::lua::write_script(dpp(), store, tenant, null_yield, script_ctx, script); + auto lua_manager = store->get_lua_manager(); + rc = rgw::lua::write_script(dpp(), lua_manager.get(), tenant, null_yield, script_ctx, script); if (rc < 0) { cerr << "ERROR: failed to put script. error: " << rc << std::endl; return -rc; @@ -10411,8 +10412,9 @@ next: cerr << "ERROR: invalid script context: " << *str_script_ctx << ". must be one of: preRequest, postRequest, background" << std::endl; return EINVAL; } + auto lua_manager = store->get_lua_manager(); std::string script; - const auto rc = rgw::lua::read_script(dpp(), store, tenant, null_yield, script_ctx, script); + const auto rc = rgw::lua::read_script(dpp(), lua_manager.get(), tenant, null_yield, script_ctx, script); if (rc == -ENOENT) { std::cout << "no script exists for context: " << *str_script_ctx << (tenant.empty() ? "" : (" in tenant: " + tenant)) << std::endl; @@ -10434,7 +10436,8 @@ next: cerr << "ERROR: invalid script context: " << *str_script_ctx << ". must be one of: preRequest, postRequest, background" << std::endl; return EINVAL; } - const auto rc = rgw::lua::delete_script(dpp(), store, tenant, null_yield, script_ctx); + auto lua_manager = store->get_lua_manager(); + const auto rc = rgw::lua::delete_script(dpp(), lua_manager.get(), tenant, null_yield, script_ctx); if (rc < 0) { cerr << "ERROR: failed to remove script. error: " << rc << std::endl; return -rc; diff --git a/src/rgw/rgw_asio_frontend.cc b/src/rgw/rgw_asio_frontend.cc index 8f2c8a25b8eb..064a6d72ffd3 100644 --- a/src/rgw/rgw_asio_frontend.cc +++ b/src/rgw/rgw_asio_frontend.cc @@ -183,6 +183,7 @@ void handle_connection(boost::asio::io_context& context, parse_buffer& buffer, bool is_ssl, SharedMutex& pause_mutex, rgw::dmclock::Scheduler *scheduler, + std::unique_ptr& lua_manager, boost::system::error_code& ec, yield_context yield) { @@ -269,7 +270,9 @@ void handle_connection(boost::asio::io_context& context, *env.auth_registry, &client, env.olog, y, scheduler, &user, &latency, env.ratelimiting->get_active(), - &http_ret, env.lua_background); + env.lua_background, + lua_manager, + &http_ret); if (cct->_conf->subsys.should_gather(ceph_subsys_rgw_access, 1)) { // access log line elements begin per Apache Combined Log Format with additions following @@ -383,6 +386,7 @@ class AsioFrontend { #endif SharedMutex pause_mutex; std::unique_ptr scheduler; + std::unique_ptr lua_manager; struct Listener { tcp::endpoint endpoint; @@ -413,7 +417,8 @@ class AsioFrontend { public: AsioFrontend(const RGWProcessEnv& env, RGWFrontendConfig* conf, dmc::SchedulerCtx& sched_ctx) - : env(env), conf(conf), pause_mutex(context.get_executor()) + : env(env), conf(conf), pause_mutex(context.get_executor()), + lua_manager(env.store->get_lua_manager()) { auto sched_t = dmc::get_scheduler_t(ctx()); switch(sched_t){ @@ -1004,6 +1009,7 @@ void AsioFrontend::accept(Listener& l, boost::system::error_code ec) conn->buffer.consume(bytes); handle_connection(context, env, stream, timeout, header_limit, conn->buffer, true, pause_mutex, scheduler.get(), + lua_manager, ec, yield); if (!ec) { // ssl shutdown (ignoring errors) @@ -1023,6 +1029,7 @@ void AsioFrontend::accept(Listener& l, boost::system::error_code ec) boost::system::error_code ec; handle_connection(context, env, conn->socket, timeout, header_limit, conn->buffer, false, pause_mutex, scheduler.get(), + lua_manager, ec, yield); conn->socket.shutdown(tcp_socket::shutdown_both, ec); }, make_stack_allocator()); @@ -1108,6 +1115,7 @@ void AsioFrontend::unpause(rgw::sal::Store* const store, { env.store = store; env.auth_registry = std::move(auth_registry); + lua_manager = store->get_lua_manager(); // unpause to unblock connections pause_mutex.unlock(); diff --git a/src/rgw/rgw_loadgen_process.cc b/src/rgw/rgw_loadgen_process.cc index 38b751097436..e5a966b4fd77 100644 --- a/src/rgw/rgw_loadgen_process.cc +++ b/src/rgw/rgw_loadgen_process.cc @@ -137,7 +137,9 @@ void RGWLoadGenProcess::handle_request(const DoutPrefixProvider *dpp, RGWRequest int ret = process_request(store, rest, req, uri_prefix, *auth_registry, &client_io, olog, null_yield, nullptr, nullptr, nullptr, - ratelimit.get_active(), nullptr); + ratelimit.get_active(), + nullptr, + lua_manager); if (ret < 0) { /* we don't really care about return code */ dout(20) << "process_request() returned " << ret << dendl; diff --git a/src/rgw/rgw_lua.cc b/src/rgw/rgw_lua.cc index e0f61049b605..2d4833e2ebf4 100644 --- a/src/rgw/rgw_lua.cc +++ b/src/rgw/rgw_lua.cc @@ -67,25 +67,21 @@ std::string script_oid(context ctx, const std::string& tenant) { } -int read_script(const DoutPrefixProvider *dpp, rgw::sal::Store* store, const std::string& tenant, optional_yield y, context ctx, std::string& script) +int read_script(const DoutPrefixProvider *dpp, sal::LuaManager* manager, const std::string& tenant, optional_yield y, context ctx, std::string& script) { - auto lua_mgr = store->get_lua_manager(); - return lua_mgr->get_script(dpp, y, script_oid(ctx, tenant), script); + return manager->get_script(dpp, y, script_oid(ctx, tenant), script); + } -int write_script(const DoutPrefixProvider *dpp, rgw::sal::Store* store, const std::string& tenant, optional_yield y, context ctx, const std::string& script) +int write_script(const DoutPrefixProvider *dpp, sal::LuaManager* manager, const std::string& tenant, optional_yield y, context ctx, const std::string& script) { - auto lua_mgr = store->get_lua_manager(); - - return lua_mgr->put_script(dpp, y, script_oid(ctx, tenant), script); + return manager->put_script(dpp, y, script_oid(ctx, tenant), script); } -int delete_script(const DoutPrefixProvider *dpp, rgw::sal::Store* store, const std::string& tenant, optional_yield y, context ctx) +int delete_script(const DoutPrefixProvider *dpp, sal::LuaManager* manager, const std::string& tenant, optional_yield y, context ctx) { - auto lua_mgr = store->get_lua_manager(); - - return lua_mgr->del_script(dpp, y, script_oid(ctx, tenant)); + return manager->del_script(dpp, y, script_oid(ctx, tenant)); } #ifdef WITH_RADOSGW_LUA_PACKAGES diff --git a/src/rgw/rgw_lua.h b/src/rgw/rgw_lua.h index 0596ee104115..562a80c6c3d3 100644 --- a/src/rgw/rgw_lua.h +++ b/src/rgw/rgw_lua.h @@ -9,8 +9,10 @@ class lua_State; class rgw_user; +class DoutPrefixProvider; namespace rgw::sal { class RadosStore; + class LuaManager; } namespace rgw::lua { @@ -31,13 +33,13 @@ context to_context(const std::string& s); bool verify(const std::string& script, std::string& err_msg); // store a lua script in a context -int write_script(const DoutPrefixProvider *dpp, rgw::sal::Store* store, const std::string& tenant, optional_yield y, context ctx, const std::string& script); +int write_script(const DoutPrefixProvider *dpp, rgw::sal::LuaManager* manager, const std::string& tenant, optional_yield y, context ctx, const std::string& script); // read the stored lua script from a context -int read_script(const DoutPrefixProvider *dpp, rgw::sal::Store* store, const std::string& tenant, optional_yield y, context ctx, std::string& script); +int read_script(const DoutPrefixProvider *dpp, rgw::sal::LuaManager* manager, const std::string& tenant, optional_yield y, context ctx, std::string& script); // delete the stored lua script from a context -int delete_script(const DoutPrefixProvider *dpp, rgw::sal::Store* store, const std::string& tenant, optional_yield y, context ctx); +int delete_script(const DoutPrefixProvider *dpp, rgw::sal::LuaManager* manager, const std::string& tenant, optional_yield y, context ctx); using packages_t = std::set; diff --git a/src/rgw/rgw_lua_background.cc b/src/rgw/rgw_lua_background.cc index ea85193edf7c..a8d31c8ab361 100644 --- a/src/rgw/rgw_lua_background.cc +++ b/src/rgw/rgw_lua_background.cc @@ -1,3 +1,4 @@ +#include "rgw_sal_rados.h" #include "rgw_lua_background.h" #include "rgw_lua.h" #include "rgw_lua_utils.h" @@ -61,7 +62,7 @@ Background::Background(rgw::sal::Store* store, int execute_interval) : execute_interval(execute_interval), dp(cct, dout_subsys, "lua background: "), - store(store), + lua_manager(store->get_lua_manager()), cct(cct), luarocks_path(luarocks_path) {} @@ -95,8 +96,8 @@ void Background::pause() { cond.notify_all(); } -void Background::resume(rgw::sal::Store* _store) { - store = _store; +void Background::resume(rgw::sal::Store* store) { + lua_manager = store->get_lua_manager(); paused = false; cond.notify_all(); } @@ -107,7 +108,7 @@ int Background::read_script() { return -EAGAIN; } std::string tenant; - return rgw::lua::read_script(&dp, store, tenant, null_yield, rgw::lua::context::background, rgw_script); + return rgw::lua::read_script(&dp, lua_manager.get(), tenant, null_yield, rgw::lua::context::background, rgw_script); } const BackgroundMapValue Background::empty_table_value; diff --git a/src/rgw/rgw_lua_background.h b/src/rgw/rgw_lua_background.h index c6051164eb42..878baf3dba0f 100644 --- a/src/rgw/rgw_lua_background.h +++ b/src/rgw/rgw_lua_background.h @@ -189,7 +189,7 @@ private: bool paused = false; int execute_interval; const DoutPrefix dp; - rgw::sal::Store* store; + std::unique_ptr lua_manager; CephContext* const cct; const std::string luarocks_path; std::thread runner; diff --git a/src/rgw/rgw_process.cc b/src/rgw/rgw_process.cc index 1d4c8014c1fd..8c13105e872d 100644 --- a/src/rgw/rgw_process.cc +++ b/src/rgw/rgw_process.cc @@ -273,8 +273,9 @@ int process_request(rgw::sal::Store* const store, string* user, ceph::coarse_real_clock::duration* latency, std::shared_ptr ratelimit, - int* http_ret, - rgw::lua::Background* lua_background) + rgw::lua::Background* lua_background, + std::unique_ptr& lua_manager, + int* http_ret) { int ret = client_io->init(g_ceph_context); dout(1) << "====== starting new request req=" << hex << req << dec @@ -330,7 +331,7 @@ int process_request(rgw::sal::Store* const store, { s->trace_enabled = tracing::rgw::tracer.is_enabled(); std::string script; - auto rc = rgw::lua::read_script(s, store, s->bucket_tenant, s->yield, rgw::lua::context::preRequest, script); + auto rc = rgw::lua::read_script(s, lua_manager.get(), s->bucket_tenant, s->yield, rgw::lua::context::preRequest, script); if (rc == -ENOENT) { // no script, nothing to do } else if (rc < 0) { @@ -413,7 +414,7 @@ done: s->trace->SetAttribute(tracing::rgw::OBJECT_NAME, s->object->get_name()); } std::string script; - auto rc = rgw::lua::read_script(s, store, s->bucket_tenant, s->yield, rgw::lua::context::postRequest, script); + auto rc = rgw::lua::read_script(s, lua_manager.get(), s->bucket_tenant, s->yield, rgw::lua::context::postRequest, script); if (rc == -ENOENT) { // no script, nothing to do } else if (rc < 0) { diff --git a/src/rgw/rgw_process.h b/src/rgw/rgw_process.h index c40a9beaf3be..964842811cf9 100644 --- a/src/rgw/rgw_process.h +++ b/src/rgw/rgw_process.h @@ -63,6 +63,7 @@ protected: int sock_fd; std::string uri_prefix; rgw::lua::Background* lua_background; + std::unique_ptr lua_manager; struct RGWWQ : public DoutPrefixProvider, public ThreadPool::WorkQueue { RGWProcess* process; @@ -115,6 +116,7 @@ public: sock_fd(-1), uri_prefix(pe->uri_prefix), lua_background(pe->lua_background), + lua_manager(store->get_lua_manager()), req_wq(this, ceph::make_timespan(g_conf()->rgw_op_thread_timeout), ceph::make_timespan(g_conf()->rgw_op_thread_suicide_timeout), @@ -134,6 +136,7 @@ public: rgw_auth_registry_ptr_t auth_registry) { this->store = store; this->auth_registry = std::move(auth_registry); + lua_manager = store->get_lua_manager(); m_tp.unpause(); } @@ -183,8 +186,9 @@ extern int process_request(rgw::sal::Store* store, std::string* user, ceph::coarse_real_clock::duration* latency, std::shared_ptr ratelimit, - int* http_ret = nullptr, - rgw::lua::Background* lua_background = nullptr); + rgw::lua::Background* lua_background, + std::unique_ptr& lua_manager, + int* http_ret = nullptr); extern int rgw_process_authenticated(RGWHandler_REST* handler, RGWOp*& op, diff --git a/src/rgw/rgw_sal_rados.cc b/src/rgw/rgw_sal_rados.cc index 0955366f6d01..c063467a2c81 100644 --- a/src/rgw/rgw_sal_rados.cc +++ b/src/rgw/rgw_sal_rados.cc @@ -3009,13 +3009,17 @@ const std::string_view RadosZone::get_tier_type() return store->svc()->zone->get_zone().tier_type; } -RadosLuaManager::RadosLuaManager(RadosStore* _s) : store(_s) -{ - pool = store->svc()->zone->get_zone_params().log_pool; -} +RadosLuaManager::RadosLuaManager(RadosStore* _s) : + store(_s), + pool((store->svc() && store->svc()->zone) ? store->svc()->zone->get_zone_params().log_pool : rgw_pool()) +{ } int RadosLuaManager::get_script(const DoutPrefixProvider* dpp, optional_yield y, const std::string& key, std::string& script) { + if (pool.empty()) { + ldpp_dout(dpp, 10) << "WARNING: missing pool when reading lua script " << dendl; + return 0; + } bufferlist bl; int r = rgw_get_system_obj(store->svc()->sysobj, pool, key, bl, nullptr, nullptr, y, dpp); @@ -3035,6 +3039,10 @@ int RadosLuaManager::get_script(const DoutPrefixProvider* dpp, optional_yield y, int RadosLuaManager::put_script(const DoutPrefixProvider* dpp, optional_yield y, const std::string& key, const std::string& script) { + if (pool.empty()) { + ldpp_dout(dpp, 10) << "WARNING: missing pool when writing lua script " << dendl; + return 0; + } bufferlist bl; ceph::encode(script, bl); @@ -3048,6 +3056,10 @@ int RadosLuaManager::put_script(const DoutPrefixProvider* dpp, optional_yield y, int RadosLuaManager::del_script(const DoutPrefixProvider* dpp, optional_yield y, const std::string& key) { + if (pool.empty()) { + ldpp_dout(dpp, 10) << "WARNING: missing pool when deleting lua script " << dendl; + return 0; + } int r = rgw_delete_system_obj(dpp, store->svc()->sysobj, pool, key, nullptr, y); if (r < 0 && r != -ENOENT) { return r; diff --git a/src/rgw/rgw_sal_rados.h b/src/rgw/rgw_sal_rados.h index 128aead8802a..e6965571ce40 100644 --- a/src/rgw/rgw_sal_rados.h +++ b/src/rgw/rgw_sal_rados.h @@ -879,7 +879,7 @@ public: }; class RadosLuaManager : public StoreLuaManager { - RadosStore* store; + RadosStore* const store; rgw_pool pool; public: diff --git a/src/test/rgw/test_rgw_lua.cc b/src/test/rgw/test_rgw_lua.cc index 110e6addd84c..aed870269251 100644 --- a/src/test/rgw/test_rgw_lua.cc +++ b/src/test/rgw/test_rgw_lua.cc @@ -630,6 +630,9 @@ TEST(TestRGWLua, NotAllowedInLib) ASSERT_NE(rc, 0); } +#define MAKE_STORE auto store = std::unique_ptr(new sal::RadosStore); \ + store->setRados(new RGWRados); + TEST(TestRGWLua, OpsLog) { const std::string script = R"( @@ -641,8 +644,7 @@ TEST(TestRGWLua, OpsLog) end )"; - auto store = std::unique_ptr(new sal::RadosStore); - store->setRados(new RGWRados); + MAKE_STORE; struct MockOpsLogSink : OpsLogSink { bool logged = false; @@ -684,6 +686,7 @@ TEST(TestRGWLua, OpsLog) class TestBackground : public rgw::lua::Background { const unsigned read_time; + protected: int read_script() override { // don't read the object from the store @@ -692,8 +695,8 @@ protected: } public: - TestBackground(const std::string& script, unsigned read_time = 0) : - rgw::lua::Background(nullptr, g_cct, "", 1 /*run every second*/), + TestBackground(sal::RadosStore* store, const std::string& script, unsigned read_time = 0) : + rgw::lua::Background(store, g_cct, "", /* luarocks path */ 1 /* run every second */), read_time(read_time) { // the script is passed in the constructor rgw_script = script; @@ -706,13 +709,14 @@ public: TEST(TestRGWLuaBackground, Start) { + MAKE_STORE; { // ctr and dtor without running - TestBackground lua_background(""); + TestBackground lua_background(store.get(), ""); } { // ctr and dtor with running - TestBackground lua_background(""); + TestBackground lua_background(store.get(), ""); lua_background.start(); } } @@ -738,7 +742,8 @@ TEST(TestRGWLuaBackground, Script) RGW[key] = value )"; - TestBackground lua_background(script); + MAKE_STORE; + TestBackground lua_background(store.get(), script); lua_background.start(); std::this_thread::sleep_for(wait_time); EXPECT_EQ(get_table_value(lua_background, "hello"), "world"); @@ -752,7 +757,8 @@ TEST(TestRGWLuaBackground, RequestScript) RGW[key] = value )"; - TestBackground lua_background(background_script); + MAKE_STORE; + TestBackground lua_background(store.get(), background_script); lua_background.start(); std::this_thread::sleep_for(wait_time); @@ -771,7 +777,7 @@ TEST(TestRGWLuaBackground, RequestScript) ASSERT_EQ(rc, 0); EXPECT_EQ(get_table_value(lua_background, "hello"), "from request"); // now we resume and let the background set the value - lua_background.resume(nullptr); + lua_background.resume(store.get()); std::this_thread::sleep_for(wait_time); EXPECT_EQ(get_table_value(lua_background, "hello"), "from background"); } @@ -788,7 +794,8 @@ TEST(TestRGWLuaBackground, Pause) end )"; - TestBackground lua_background(script); + MAKE_STORE; + TestBackground lua_background(store.get(), script); lua_background.start(); std::this_thread::sleep_for(wait_time); const auto value_len = get_table_value(lua_background, "hello").size(); @@ -812,8 +819,9 @@ TEST(TestRGWLuaBackground, PauseWhileReading) end )"; + MAKE_STORE; constexpr auto long_wait_time = std::chrono::seconds(6); - TestBackground lua_background(script, 2); + TestBackground lua_background(store.get(), script, 2); lua_background.start(); std::this_thread::sleep_for(long_wait_time); const auto value_len = get_table_value(lua_background, "hello").size(); @@ -832,12 +840,13 @@ TEST(TestRGWLuaBackground, ReadWhilePaused) RGW[key] = value )"; - TestBackground lua_background(script); + MAKE_STORE; + TestBackground lua_background(store.get(), script); lua_background.pause(); lua_background.start(); std::this_thread::sleep_for(wait_time); EXPECT_EQ(get_table_value(lua_background, "hello"), ""); - lua_background.resume(nullptr); + lua_background.resume(store.get()); std::this_thread::sleep_for(wait_time); EXPECT_EQ(get_table_value(lua_background, "hello"), "world"); } @@ -854,7 +863,8 @@ TEST(TestRGWLuaBackground, PauseResume) end )"; - TestBackground lua_background(script); + MAKE_STORE; + TestBackground lua_background(store.get(), script); lua_background.start(); std::this_thread::sleep_for(wait_time); const auto value_len = get_table_value(lua_background, "hello").size(); @@ -863,7 +873,7 @@ TEST(TestRGWLuaBackground, PauseResume) std::this_thread::sleep_for(wait_time); // no change in len EXPECT_EQ(value_len, get_table_value(lua_background, "hello").size()); - lua_background.resume(nullptr); + lua_background.resume(store.get()); std::this_thread::sleep_for(wait_time); // should be a change in len EXPECT_GT(get_table_value(lua_background, "hello").size(), value_len); @@ -881,7 +891,8 @@ TEST(TestRGWLuaBackground, MultipleStarts) end )"; - TestBackground lua_background(script); + MAKE_STORE; + TestBackground lua_background(store.get(), script); lua_background.start(); std::this_thread::sleep_for(wait_time); const auto value_len = get_table_value(lua_background, "hello").size(); @@ -898,7 +909,8 @@ TEST(TestRGWLuaBackground, MultipleStarts) TEST(TestRGWLuaBackground, TableValues) { - TestBackground lua_background(""); + MAKE_STORE; + TestBackground lua_background(store.get(), ""); const std::string request_script = R"( RGW["key1"] = "string value" @@ -919,7 +931,8 @@ TEST(TestRGWLuaBackground, TableValues) TEST(TestRGWLuaBackground, TablePersist) { - TestBackground lua_background(""); + MAKE_STORE; + TestBackground lua_background(store.get(), ""); std::string request_script = R"( RGW["key1"] = "string value" @@ -948,7 +961,8 @@ TEST(TestRGWLuaBackground, TablePersist) TEST(TestRGWLuaBackground, TableValuesFromRequest) { - TestBackground lua_background(""); + MAKE_STORE; + TestBackground lua_background(store.get(), ""); lua_background.start(); const std::string request_script = R"( @@ -974,7 +988,8 @@ TEST(TestRGWLuaBackground, TableValuesFromRequest) TEST(TestRGWLuaBackground, TableInvalidValue) { - TestBackground lua_background(""); + MAKE_STORE; + TestBackground lua_background(store.get(), ""); lua_background.start(); const std::string request_script = R"( @@ -999,7 +1014,8 @@ TEST(TestRGWLuaBackground, TableInvalidValue) TEST(TestRGWLuaBackground, TableErase) { - TestBackground lua_background(""); + MAKE_STORE; + TestBackground lua_background(store.get(), ""); std::string request_script = R"( RGW["size"] = 0 @@ -1036,7 +1052,8 @@ TEST(TestRGWLuaBackground, TableErase) TEST(TestRGWLuaBackground, TableIterate) { - TestBackground lua_background(""); + MAKE_STORE; + TestBackground lua_background(store.get(), ""); const std::string request_script = R"( RGW["key1"] = "string value" @@ -1062,7 +1079,8 @@ TEST(TestRGWLuaBackground, TableIterate) TEST(TestRGWLuaBackground, TableIncrement) { - TestBackground lua_background(""); + MAKE_STORE; + TestBackground lua_background(store.get(), ""); const std::string request_script = R"( RGW["key1"] = 42 @@ -1081,7 +1099,8 @@ TEST(TestRGWLuaBackground, TableIncrement) TEST(TestRGWLuaBackground, TableIncrementBy) { - TestBackground lua_background(""); + MAKE_STORE; + TestBackground lua_background(store.get(), ""); const std::string request_script = R"( RGW["key1"] = 42 @@ -1102,7 +1121,8 @@ TEST(TestRGWLuaBackground, TableIncrementBy) TEST(TestRGWLuaBackground, TableDecrement) { - TestBackground lua_background(""); + MAKE_STORE; + TestBackground lua_background(store.get(), ""); const std::string request_script = R"( RGW["key1"] = 42 @@ -1121,7 +1141,8 @@ TEST(TestRGWLuaBackground, TableDecrement) TEST(TestRGWLuaBackground, TableDecrementBy) { - TestBackground lua_background(""); + MAKE_STORE; + TestBackground lua_background(store.get(), ""); const std::string request_script = R"( RGW["key1"] = 42 @@ -1142,7 +1163,8 @@ TEST(TestRGWLuaBackground, TableDecrementBy) TEST(TestRGWLuaBackground, TableIncrementValueError) { - TestBackground lua_background(""); + MAKE_STORE; + TestBackground lua_background(store.get(), ""); std::string request_script = R"( -- cannot increment string values @@ -1176,7 +1198,8 @@ TEST(TestRGWLuaBackground, TableIncrementValueError) TEST(TestRGWLuaBackground, TableIncrementError) { - TestBackground lua_background(""); + MAKE_STORE; + TestBackground lua_background(store.get(), ""); std::string request_script = R"( -- missing argument