system_keyspace: Use system_keyspace's container() to flush

In force_blocking_flush() there's an invoke-on-all invocation of
replica::database::flush() and a FIXME to get the replica database from
somewhere else rather than via query-processor -> data_dictionary.

Since now the force_blocking_flush() is non-static the invoke-on-all can
happen via system_keyspace's container and the database can be obtained
directly from the sys.ks. local instance

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
This commit is contained in:
Pavel Emelyanov
2023-08-08 10:39:37 +03:00
parent 7a342ed5c0
commit d7f5d6dba8

View File

@@ -1722,9 +1722,9 @@ future<> system_keyspace::update_tokens(const std::unordered_set<dht::token>& to
future<> system_keyspace::force_blocking_flush(sstring cfname) {
assert(qctx);
return _qp.container().invoke_on_all([cfname = std::move(cfname)] (cql3::query_processor& qp) {
return container().invoke_on_all([cfname = std::move(cfname)] (db::system_keyspace& sys_ks) {
// if (!Boolean.getBoolean("cassandra.unsafesystem"))
return qp.db().real_database().flush(NAME, cfname); // FIXME: get real database in another way
return sys_ks._db.flush(NAME, cfname);
});
}