From f89a25562cc284cee83ecfc2879e39e435d14cf5 Mon Sep 17 00:00:00 2001 From: Asias He Date: Mon, 7 Sep 2015 16:21:03 +0800 Subject: [PATCH] storage_service: Fix is_auto_bootstrap Get the value from cfg option. --- db/config.hh | 2 +- service/storage_service.cc | 5 ++--- service/storage_service.hh | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/db/config.hh b/db/config.hh index 39a1e1d5a3..87313360c8 100644 --- a/db/config.hh +++ b/db/config.hh @@ -348,7 +348,7 @@ public: /* Advanced properties */ \ /* Properties for advanced users or properties that are less commonly used. */ \ /* Advanced initialization properties */ \ - val(auto_bootstrap, bool, true, Unused, \ + val(auto_bootstrap, bool, true, Used, \ "This setting has been removed from default configuration. It makes new (non-seed) nodes automatically migrate the right data to themselves. When initializing a fresh cluster with no data, add auto_bootstrap: false.\n" \ "Related information: Initializing a multiple node cluster (single data center) and Initializing a multiple node cluster (multiple data centers)." \ ) \ diff --git a/service/storage_service.cc b/service/storage_service.cc index 4beca30963..763921f450 100644 --- a/service/storage_service.cc +++ b/service/storage_service.cc @@ -61,9 +61,8 @@ bool is_replacing() { return false; } -bool is_auto_bootstrap() { - // FIXME: DatabaseDescriptor.isAutoBootstrap() - return true; +bool storage_service::is_auto_bootstrap() { + return _db.local().get_config().auto_bootstrap(); } std::set get_seeds() { diff --git a/service/storage_service.hh b/service/storage_service.hh index eafa9f8406..dea9755c9f 100644 --- a/service/storage_service.hh +++ b/service/storage_service.hh @@ -81,6 +81,7 @@ public: void gossip_snitch_info(); private: + bool is_auto_bootstrap(); inet_address get_broadcast_address() { return utils::fb_utilities::get_broadcast_address(); }