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:
Piotr Sarna
2018-10-03 15:50:31 +02:00
parent ca5dfdffc6
commit eb0c507a45

12
main.cc
View File

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