diff --git a/api/storage_service.cc b/api/storage_service.cc index 2c5097ef3b..74ac261dc1 100644 --- a/api/storage_service.cc +++ b/api/storage_service.cc @@ -588,6 +588,8 @@ void set_storage_service(http_context& ctx, routes& r) { auto val_str = req->get_query_param("value"); bool value = (val_str == "True") || (val_str == "true") || (val_str == "1"); return service::get_local_storage_service().db().invoke_on_all([value] (database& db) { + db.set_enable_incremental_backups(value); + // Change both KS and CF, so they are in sync for (auto& pair: db.get_keyspaces()) { auto& ks = pair.second; diff --git a/database.cc b/database.cc index c30abb9e36..ffe854335b 100644 --- a/database.cc +++ b/database.cc @@ -1028,6 +1028,7 @@ database::database() : database(db::config()) database::database(const db::config& cfg) : _cfg(std::make_unique(cfg)) , _version(empty_version) + , _enable_incremental_backups(cfg.incremental_backups()) { _memtable_total_space = size_t(_cfg->memtable_total_space_in_mb()) << 20; if (!_memtable_total_space) { @@ -1834,7 +1835,7 @@ database::make_keyspace_config(const keyspace_metadata& ksm) { } cfg.dirty_memory_region_group = &_dirty_memory_region_group; cfg.cf_stats = &_cf_stats; - cfg.enable_incremental_backups = _cfg->incremental_backups(); + cfg.enable_incremental_backups = _enable_incremental_backups; return cfg; } diff --git a/database.hh b/database.hh index 1224d49696..ce2f8df980 100644 --- a/database.hh +++ b/database.hh @@ -570,6 +570,7 @@ class database { std::vector _collectd; timer<> _throttling_timer{[this] { unthrottle(); }}; circular_buffer> _throttled_requests; + bool _enable_incremental_backups = false; future<> init_commitlog(); future<> apply_in_memory(const frozen_mutation& m, const schema_ptr& m_schema, const db::replay_position&); @@ -589,6 +590,8 @@ private: public: static utils::UUID empty_version; + void set_enable_incremental_backups(bool val) { _enable_incremental_backups = val; } + future<> parse_system_tables(distributed&); database(); database(const db::config&);