mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-03 21:47:10 +00:00
main: add generating missed mv updates from staging sstables
If any sstables are found in the staging directory, it means that they missed generating view updates, so it's performed now.
This commit is contained in:
12
main.cc
12
main.cc
@@ -62,6 +62,7 @@
|
||||
#include "service/cache_hitrate_calculator.hh"
|
||||
#include "sstables/compaction_manager.hh"
|
||||
#include "sstables/sstables.hh"
|
||||
#include <db/view/view_update_from_staging_generator.hh>
|
||||
|
||||
seastar::metrics::metric_groups app_metrics;
|
||||
|
||||
@@ -755,6 +756,13 @@ int main(int ac, char** av) {
|
||||
local_proxy.allow_replaying_hints();
|
||||
}).get();
|
||||
|
||||
static sharded<db::view::view_update_from_staging_generator> view_update_from_staging_generator;
|
||||
if (cfg->view_building()) {
|
||||
supervisor::notify("Launching generate_mv_updates for non system tables");
|
||||
view_update_from_staging_generator.start(std::ref(db), std::ref(proxy)).get();
|
||||
view_update_from_staging_generator.invoke_on_all(&db::view::view_update_from_staging_generator::start).get();
|
||||
}
|
||||
|
||||
static sharded<db::view::view_builder> view_builder;
|
||||
if (cfg->view_building()) {
|
||||
supervisor::notify("starting the view builder");
|
||||
@@ -800,6 +808,10 @@ int main(int ac, char** av) {
|
||||
return view_builder.stop();
|
||||
});
|
||||
|
||||
engine().at_exit([] {
|
||||
return view_update_from_staging_generator.stop();
|
||||
});
|
||||
|
||||
engine().at_exit([&db] {
|
||||
return db.invoke_on_all([](auto& db) {
|
||||
return db.get_compaction_manager().stop();
|
||||
|
||||
Reference in New Issue
Block a user