db: token_ring_table: Filter out tablet-based keyspaces

Querying from virtual table system.token_ring fails if there is a
tablet-based table due to attempt to obtain a per-keyspace erm.

Fix by not showing such keyspaces.
This commit is contained in:
Tomasz Grabiec
2023-05-15 22:38:28 +02:00
parent 2303466375
commit 16797c2d1a

View File

@@ -2026,7 +2026,12 @@ public:
};
auto keyspace_names = boost::copy_range<std::vector<decorated_keyspace_name>>(
_db.get_keyspaces() | boost::adaptors::transformed([this] (auto&& e) {
_db.get_keyspaces()
| boost::adaptors::filtered([] (auto&& e) {
auto&& rs = e.second.get_replication_strategy();
return rs.is_vnode_based();
})
| boost::adaptors::transformed([this] (auto&& e) {
return decorated_keyspace_name{e.first, make_partition_key(e.first)};
}));