From ec4040496b410041ba5ccfd5fdd2d3ecda2a8d52 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Mon, 31 Jul 2023 09:53:40 +0300 Subject: [PATCH] system_keyspace: Reuse container() and _db member for flushing The set_scylla_local_param_as() wants to flush replica::database on all shards. For that it uses smp::invoke_on_all() and qctx, but since the method is now non-static one for system_keyspace it can enjoy usiing container().invoke_on_all() and this->_db (on target shard) Signed-off-by: Pavel Emelyanov --- db/system_keyspace.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/system_keyspace.cc b/db/system_keyspace.cc index 94808be83e..907cf6ebdc 100644 --- a/db/system_keyspace.cc +++ b/db/system_keyspace.cc @@ -1668,8 +1668,8 @@ future<> system_keyspace::set_scylla_local_param_as(const sstring& key, const T& co_await qctx->execute_cql(req, type->to_string_impl(data_value(value)), key).discard_result(); // Flush the table so that the value is available on boot before commitlog replay. // database::maybe_init_schema_commitlog() depends on it. - co_await smp::invoke_on_all([] () -> future<> { - co_await qctx->qp().db().real_database().flush(db::system_keyspace::NAME, system_keyspace::SCYLLA_LOCAL); + co_await container().invoke_on_all([] (auto& sys_ks) -> future<> { + co_await sys_ks._db.flush(db::system_keyspace::NAME, system_keyspace::SCYLLA_LOCAL); }); }