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 <xemul@scylladb.com>
This commit is contained in:
Pavel Emelyanov
2023-07-31 09:53:40 +03:00
parent 1ac4b7d2fe
commit ec4040496b

View File

@@ -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);
});
}