db/view: Require configuration option to enable view building

View building, enabled by default, can contain or expose issues that
prevent the node from starting. In those cases, it is necessary to
disable view building such that the node can be submitted to
maintenance operations.

Fixes #3329

Signed-off-by: Duarte Nunes <duarte@scylladb.com>
This commit is contained in:
Duarte Nunes
2018-04-03 13:07:46 +01:00
parent 11ece46f14
commit bf5045c7eb
2 changed files with 6 additions and 3 deletions

View File

@@ -735,6 +735,7 @@ public:
val(enable_sstable_data_integrity_check, bool, false, Used, "Enable interposer which checks for integrity of every sstable write." \
" Performance is affected to some extent as a result. Useful to help debugging problems that may arise at another layers.") \
val(cpu_scheduler, bool, true, Used, "Enable cpu scheduling") \
val(view_building, bool, true, Used, "Enable view building; should only be set to false when the node is experience issues due to view building") \
/* done! */
#define _make_value_member(name, type, deflt, status, desc, ...) \

View File

@@ -706,9 +706,11 @@ int main(int ac, char** av) {
}
static sharded<db::view::view_builder> view_builder;
supervisor::notify("starting the view builder");
view_builder.start(std::ref(db), std::ref(sys_dist_ks), std::ref(mm)).get();
view_builder.invoke_on_all(&db::view::view_builder::start).get();
if (cfg->view_building()) {
supervisor::notify("starting the view builder");
view_builder.start(std::ref(db), std::ref(sys_dist_ks), std::ref(mm)).get();
view_builder.invoke_on_all(&db::view::view_builder::start).get();
}
supervisor::notify("starting native transport");
service::get_local_storage_service().start_native_transport().get();