diff --git a/db/view/view_update_generator.cc b/db/view/view_update_generator.cc index 7f6946def3..07bece8808 100644 --- a/db/view/view_update_generator.cc +++ b/db/view/view_update_generator.cc @@ -172,10 +172,10 @@ void view_update_generator::setup_metrics() { void view_update_generator::discover_staging_sstables() { for (auto& x : _db.get_column_families()) { - replica::table& t = *(x.second); - for (auto sstables = t.get_sstables(); sstables::shared_sstable sst : *sstables) { + auto t = x.second->shared_from_this(); + for (auto sstables = t->get_sstables(); sstables::shared_sstable sst : *sstables) { if (sst->requires_view_building()) { - _sstables_with_tables[t.shared_from_this()].push_back(std::move(sst)); + _sstables_with_tables[t].push_back(std::move(sst)); // we're at early stage here, no need to kick _pending_sstables (the // bulding fiber is not running), neither we can wait on the semaphore _registration_sem.consume(1);