This is an automated email from the ASF dual-hosted git repository.

laiyingchun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pegasus.git


The following commit(s) were added to refs/heads/master by this push:
     new 9b160a935 refactor(conf): use DSN_DEFINE_bool to load bool type of 
configs (#1363)
9b160a935 is described below

commit 9b160a93550e3c6b57aa9ef48c5fc725f08b43d7
Author: Yingchun Lai <[email protected]>
AuthorDate: Mon Feb 27 17:36:37 2023 +0800

    refactor(conf): use DSN_DEFINE_bool to load bool type of configs (#1363)
---
 src/common/replication_common.cpp                  | 102 +--------------
 src/common/replication_common.h                    |  26 +---
 src/common/test/config-test.ini                    |   3 -
 src/failure_detector/test/config-test.ini          |   3 -
 .../test/config-whitelist-test-failed.ini          |   3 -
 .../test/config-whitelist-test.ini                 |   3 -
 src/meta/app_balance_policy.cpp                    |  14 ++-
 src/meta/meta_http_service.cpp                     |   2 +-
 src/meta/meta_options.cpp                          |  28 -----
 src/meta/meta_options.h                            |  11 --
 src/meta/meta_service.cpp                          |  27 ++--
 src/meta/server_state.cpp                          |  15 ++-
 src/meta/test/config-test.ini                      |   3 -
 src/meta/test/meta_state/config-test.ini           |   3 -
 src/replica/bulk_load/test/config-test.ini         |   3 -
 src/replica/replica.cpp                            |   6 +-
 src/replica/replica_check.cpp                      |   3 +-
 src/replica/replica_http_service.cpp               |   2 +-
 src/replica/replica_init.cpp                       |   4 +-
 src/replica/replica_stub.cpp                       |  61 ++++++---
 src/replica/split/test/config-test.ini             |   3 -
 .../storage/simple_kv/simple_kv.server.impl.cpp    |   6 +-
 .../storage/simple_kv/simple_kv.server.impl.h      |   1 -
 .../simple_kv/test/simple_kv.server.impl.cpp       |   6 +-
 .../storage/simple_kv/test/simple_kv.server.impl.h |   1 -
 src/replica/test/config-test.ini                   |   3 -
 src/replica/test/replica_http_service_test.cpp     |   7 +-
 src/runtime/profiler.cpp                           |  25 ++--
 src/runtime/service_api_c.cpp                      |  10 +-
 src/runtime/tracer.cpp                             |  12 +-
 src/server/pegasus_server_impl.cpp                 |  48 ++++----
 src/server/pegasus_server_impl.h                   |   1 -
 src/server/pegasus_server_impl_init.cpp            | 137 +++++++++++----------
 src/server/pegasus_server_write.cpp                |   7 +-
 src/server/pegasus_server_write.h                  |   4 +-
 src/server/test/pegasus_server_write_test.cpp      |   2 +-
 .../test/pegasus_write_service_impl_test.cpp       |   2 +-
 src/server/test/pegasus_write_service_test.cpp     |   2 +-
 src/server/test/rocksdb_wrapper_test.cpp           |   2 +-
 src/utils/simple_logger.cpp                        |  10 --
 src/utils/simple_logger.h                          |   3 +-
 src/utils/test/logger.cpp                          |   2 +-
 src/zookeeper/test/config-test.ini                 |   3 -
 43 files changed, 237 insertions(+), 382 deletions(-)

diff --git a/src/common/replication_common.cpp 
b/src/common/replication_common.cpp
index 08d2d5dfa..97681e428 100644
--- a/src/common/replication_common.cpp
+++ b/src/common/replication_common.cpp
@@ -37,6 +37,7 @@
 namespace dsn {
 namespace replication {
 
+DSN_DEFINE_bool(replication, duplication_enabled, true, "is duplication 
enabled");
 DSN_DEFINE_int32(replication,
                  max_concurrent_bulk_load_downloading_count,
                  5,
@@ -87,33 +88,6 @@ DSN_DEFINE_bool(replication,
                 "whether to disable empty write, default is false");
 DSN_TAG_VARIABLE(empty_write_disabled, FT_MUTABLE);
 
-replication_options::replication_options()
-{
-    deny_client_on_start = false;
-    verbose_client_log_on_start = false;
-    verbose_commit_log_on_start = false;
-    delay_for_fd_timeout_on_start = false;
-    duplication_enabled = true;
-
-    batch_write_disabled = false;
-
-    group_check_disabled = false;
-
-    checkpoint_disabled = false;
-
-    gc_disabled = false;
-
-    disk_stat_disabled = false;
-
-    fd_disabled = false;
-
-    log_shared_force_flush = false;
-
-    config_sync_disabled = false;
-
-    mem_release_enabled = true;
-}
-
 replication_options::~replication_options() {}
 
 void replication_options::initialize()
@@ -161,80 +135,6 @@ void replication_options::initialize()
 
     CHECK(!data_dirs.empty(), "no replica data dir found, maybe not set or 
excluded by black list");
 
-    deny_client_on_start = dsn_config_get_value_bool("replication",
-                                                     "deny_client_on_start",
-                                                     deny_client_on_start,
-                                                     "whether to deny client 
read "
-                                                     "and write requests when "
-                                                     "starting the server, 
default "
-                                                     "is false");
-    verbose_client_log_on_start = dsn_config_get_value_bool("replication",
-                                                            
"verbose_client_log_on_start",
-                                                            
verbose_client_log_on_start,
-                                                            "whether to print 
verbose error "
-                                                            "log when reply to 
client read "
-                                                            "and write 
requests when "
-                                                            "starting the 
server, default "
-                                                            "is false");
-    verbose_commit_log_on_start = dsn_config_get_value_bool("replication",
-                                                            
"verbose_commit_log_on_start",
-                                                            
verbose_commit_log_on_start,
-                                                            "whether to print 
verbose log "
-                                                            "when commit 
mutation when "
-                                                            "starting the 
server, default "
-                                                            "is false");
-    delay_for_fd_timeout_on_start =
-        dsn_config_get_value_bool("replication",
-                                  "delay_for_fd_timeout_on_start",
-                                  delay_for_fd_timeout_on_start,
-                                  "whether to delay for beacon grace period to 
make failure "
-                                  "detector timeout when starting the server, 
default is false");
-
-    duplication_enabled = dsn_config_get_value_bool(
-        "replication", "duplication_enabled", duplication_enabled, "is 
duplication enabled");
-
-    batch_write_disabled =
-        dsn_config_get_value_bool("replication",
-                                  "batch_write_disabled",
-                                  batch_write_disabled,
-                                  "whether to disable auto-batch of replicated 
write requests");
-
-    group_check_disabled = dsn_config_get_value_bool("replication",
-                                                     "group_check_disabled",
-                                                     group_check_disabled,
-                                                     "whether group check is 
disabled");
-
-    checkpoint_disabled = dsn_config_get_value_bool("replication",
-                                                    "checkpoint_disabled",
-                                                    checkpoint_disabled,
-                                                    "whether checkpoint is 
disabled");
-
-    gc_disabled = dsn_config_get_value_bool(
-        "replication", "gc_disabled", gc_disabled, "whether to disable garbage 
collection");
-
-    disk_stat_disabled = dsn_config_get_value_bool(
-        "replication", "disk_stat_disabled", disk_stat_disabled, "whether to 
disable disk stat");
-
-    fd_disabled = dsn_config_get_value_bool(
-        "replication", "fd_disabled", fd_disabled, "whether to disable failure 
detection");
-
-    log_shared_force_flush =
-        dsn_config_get_value_bool("replication",
-                                  "log_shared_force_flush",
-                                  log_shared_force_flush,
-                                  "when write shared log, whether to flush 
file after write done");
-
-    config_sync_disabled = dsn_config_get_value_bool(
-        "replication",
-        "config_sync_disabled",
-        config_sync_disabled,
-        "whether to disable replica configuration periodical sync with the 
meta server");
-
-    mem_release_enabled = dsn_config_get_value_bool("replication",
-                                                    "mem_release_enabled",
-                                                    mem_release_enabled,
-                                                    "whether to enable 
periodic memory release");
-
     cold_backup_root = dsn_config_get_value_string(
         "replication", "cold_backup_root", "", "cold backup remote storage 
path prefix");
 
diff --git a/src/common/replication_common.h b/src/common/replication_common.h
index e9bf90545..531f8d18d 100644
--- a/src/common/replication_common.h
+++ b/src/common/replication_common.h
@@ -65,36 +65,12 @@ public:
     std::vector<std::string> data_dirs;
     std::vector<std::string> data_dir_tags;
 
-    bool deny_client_on_start;
-    bool verbose_client_log_on_start;
-    bool verbose_commit_log_on_start;
-    bool delay_for_fd_timeout_on_start;
-    bool duplication_enabled;
-
-    bool batch_write_disabled;
-
-    bool group_check_disabled;
-
-    bool checkpoint_disabled;
-
-    bool gc_disabled;
-
-    bool disk_stat_disabled;
-
-    bool fd_disabled;
-
-    bool log_shared_force_flush;
-
-    bool config_sync_disabled;
-
-    bool mem_release_enabled;
-
     std::string cold_backup_root;
 
     int32_t max_concurrent_bulk_load_downloading_count;
 
 public:
-    replication_options();
+    replication_options() = default;
     ~replication_options();
 
     void initialize();
diff --git a/src/common/test/config-test.ini b/src/common/test/config-test.ini
index 67dcdc287..774ac82cd 100644
--- a/src/common/test/config-test.ini
+++ b/src/common/test/config-test.ini
@@ -58,9 +58,6 @@ stderr_start_level = LOG_LEVEL_WARNING
 [tools.simulator]
 random_seed = 1465902258
 
-[tools.screen_logger]
-short_header = false
-
 [network]
 ; how many network threads for network library (used by asio)
 io_service_worker_count = 2
diff --git a/src/failure_detector/test/config-test.ini 
b/src/failure_detector/test/config-test.ini
index b1b830807..d1edd6385 100644
--- a/src/failure_detector/test/config-test.ini
+++ b/src/failure_detector/test/config-test.ini
@@ -82,9 +82,6 @@ stderr_start_level = LOG_LEVEL_WARNING
 [tools.simulator]
 random_seed = 0
 
-[tools.screen_logger]
-short_header = false
-
 [network]
 ; how many network threads for network library (used by asio)
 io_service_worker_count = 2
diff --git a/src/failure_detector/test/config-whitelist-test-failed.ini 
b/src/failure_detector/test/config-whitelist-test-failed.ini
index 0399e9d19..8332ceac0 100644
--- a/src/failure_detector/test/config-whitelist-test-failed.ini
+++ b/src/failure_detector/test/config-whitelist-test-failed.ini
@@ -83,9 +83,6 @@ stderr_start_level = LOG_LEVEL_WARNING
 [tools.simulator]
 random_seed = 0
 
-[tools.screen_logger]
-short_header = false
-
 [network]
 ; how many network threads for network library (used by asio)
 io_service_worker_count = 2
diff --git a/src/failure_detector/test/config-whitelist-test.ini 
b/src/failure_detector/test/config-whitelist-test.ini
index c5b595dca..4ee04d7af 100644
--- a/src/failure_detector/test/config-whitelist-test.ini
+++ b/src/failure_detector/test/config-whitelist-test.ini
@@ -83,9 +83,6 @@ stderr_start_level = LOG_LEVEL_WARNING
 [tools.simulator]
 random_seed = 0
 
-[tools.screen_logger]
-short_header = false
-
 [network]
 ; how many network threads for network library (used by asio)
 io_service_worker_count = 2
diff --git a/src/meta/app_balance_policy.cpp b/src/meta/app_balance_policy.cpp
index 8387b9486..0c8fb6fb9 100644
--- a/src/meta/app_balance_policy.cpp
+++ b/src/meta/app_balance_policy.cpp
@@ -19,16 +19,22 @@
 #include "utils/fmt_logging.h"
 #include "app_balance_policy.h"
 #include "meta_service.h"
+#include "utils/flags.h"
 
 namespace dsn {
 namespace replication {
-
+DSN_DEFINE_bool(meta_server, balancer_in_turn, false, "balance the apps 
one-by-one/concurrently");
+DSN_DEFINE_bool(meta_server, only_primary_balancer, false, "only try to make 
the primary balanced");
+DSN_DEFINE_bool(meta_server,
+                only_move_primary,
+                false,
+                "only try to make the primary balanced by move");
 app_balance_policy::app_balance_policy(meta_service *svc) : 
load_balance_policy(svc)
 {
     if (_svc != nullptr) {
-        _balancer_in_turn = _svc->get_meta_options()._lb_opts.balancer_in_turn;
-        _only_primary_balancer = 
_svc->get_meta_options()._lb_opts.only_primary_balancer;
-        _only_move_primary = 
_svc->get_meta_options()._lb_opts.only_move_primary;
+        _balancer_in_turn = FLAGS_balancer_in_turn;
+        _only_primary_balancer = FLAGS_only_primary_balancer;
+        _only_move_primary = FLAGS_only_move_primary;
     } else {
         _balancer_in_turn = false;
         _only_primary_balancer = false;
diff --git a/src/meta/meta_http_service.cpp b/src/meta/meta_http_service.cpp
index c445411fe..2091fc2b7 100644
--- a/src/meta/meta_http_service.cpp
+++ b/src/meta/meta_http_service.cpp
@@ -591,7 +591,7 @@ void meta_http_service::query_duplication_handler(const 
http_request &req, http_
         return;
     }
     if (_service->_dup_svc == nullptr) {
-        resp.body = "duplication is not enabled [duplication_enabled=false]";
+        resp.body = "duplication is not enabled 
[FLAGS_duplication_enabled=false]";
         resp.status_code = http_status_code::not_found;
         return;
     }
diff --git a/src/meta/meta_options.cpp b/src/meta/meta_options.cpp
index 814ee6616..6457564e8 100644
--- a/src/meta/meta_options.cpp
+++ b/src/meta/meta_options.cpp
@@ -38,7 +38,6 @@
 
 namespace dsn {
 namespace replication {
-
 std::string meta_options::concat_path_unix_style(const std::string &prefix,
                                                  const std::string &postfix)
 {
@@ -82,18 +81,6 @@ void meta_options::initialize()
                  "invalid function level: {}",
                  level_str);
 
-    recover_from_replica_server = dsn_config_get_value_bool(
-        "meta_server",
-        "recover_from_replica_server",
-        false,
-        "whether to recover from replica server when no apps in remote 
storage");
-
-    add_secondary_enable_flow_control =
-        dsn_config_get_value_bool("meta_server",
-                                  "add_secondary_enable_flow_control",
-                                  false,
-                                  "enable flow control for add secondary 
proposal");
-
     /// failure detector options
     _fd_opts.distributed_lock_service_type =
         dsn_config_get_value_string("meta_server",
@@ -113,27 +100,12 @@ void meta_options::initialize()
                                     "server_load_balancer_type",
                                     "greedy_load_balancer",
                                     "server load balancer provider");
-    _lb_opts.balancer_in_turn = dsn_config_get_value_bool(
-        "meta_server", "balancer_in_turn", false, "balance the apps 
one-by-one/concurrently");
-    _lb_opts.only_primary_balancer = dsn_config_get_value_bool(
-        "meta_server", "only_primary_balancer", false, "only try to make the 
primary balanced");
-    _lb_opts.only_move_primary = dsn_config_get_value_bool(
-        "meta_server", "only_move_primary", false, "only try to make the 
primary balanced by move");
 
     partition_guardian_type = dsn_config_get_value_string("meta_server",
                                                           
"partition_guardian_type",
                                                           "partition_guardian",
                                                           "partition guardian 
provider");
 
-    cold_backup_disabled = dsn_config_get_value_bool(
-        "meta_server", "cold_backup_disabled", true, "whether to disable cold 
backup");
-
-    enable_white_list =
-        dsn_config_get_value_bool("meta_server",
-                                  "enable_white_list",
-                                  false,
-                                  "whether to enable white list of replica 
servers");
-
     const char *replica_white_list_raw = dsn_config_get_value_string(
         "meta_server", "replica_white_list", "", "white list of 
replica-servers in meta-server");
     utils::split_args(replica_white_list_raw, replica_white_list, ',');
diff --git a/src/meta/meta_options.h b/src/meta/meta_options.h
index fa1362592..3a62eaf04 100644
--- a/src/meta/meta_options.h
+++ b/src/meta/meta_options.h
@@ -65,10 +65,6 @@ class lb_suboptions
 {
 public:
     std::string server_load_balancer_type;
-
-    bool balancer_in_turn;
-    bool only_primary_balancer;
-    bool only_move_primary;
 };
 
 class meta_options
@@ -79,17 +75,10 @@ public:
     std::vector<std::string> meta_state_service_args;
 
     meta_function_level::type meta_function_level_on_start;
-    bool recover_from_replica_server;
-
-    bool add_secondary_enable_flow_control;
 
     fd_suboptions _fd_opts;
     lb_suboptions _lb_opts;
     std::string partition_guardian_type;
-
-    bool cold_backup_disabled;
-
-    bool enable_white_list;
     std::vector<std::string> replica_white_list;
 
 public:
diff --git a/src/meta/meta_service.cpp b/src/meta/meta_service.cpp
index 2b28b8615..1249cce26 100644
--- a/src/meta/meta_service.cpp
+++ b/src/meta/meta_service.cpp
@@ -49,7 +49,15 @@
 
 namespace dsn {
 namespace replication {
-
+DSN_DEFINE_bool(meta_server,
+                recover_from_replica_server,
+                false,
+                "whether to recover from replica server when no apps in remote 
storage");
+DSN_DEFINE_bool(meta_server, cold_backup_disabled, true, "whether to disable 
cold backup");
+DSN_DEFINE_bool(meta_server,
+                enable_white_list,
+                false,
+                "whether to enable white list of replica servers");
 DSN_DEFINE_uint64(meta_server,
                   min_live_node_count_for_unfreeze,
                   3,
@@ -68,6 +76,7 @@ DSN_DEFINE_uint64(meta_server,
                   "If live_node_count * 100 < total_node_count * "
                   "node_live_percentage_threshold_for_update, then freeze the 
cluster.");
 
+DSN_DECLARE_bool(duplication_enabled);
 DSN_DECLARE_int32(fd_beacon_interval_seconds);
 DSN_DECLARE_int32(fd_check_interval_seconds);
 DSN_DECLARE_int32(fd_grace_seconds);
@@ -81,7 +90,7 @@ meta_service::meta_service()
     _node_live_percentage_threshold_for_update = 
FLAGS_node_live_percentage_threshold_for_update;
     _state.reset(new server_state());
     _function_level.store(_meta_opts.meta_function_level_on_start);
-    if (_meta_opts.recover_from_replica_server) {
+    if (FLAGS_recover_from_replica_server) {
         LOG_INFO("enter recovery mode for 
[meta_server].recover_from_replica_server = true");
         _recovering = true;
         if (_meta_opts.meta_function_level_on_start > 
meta_function_level::fl_steady) {
@@ -290,7 +299,7 @@ void meta_service::start_service()
                            server_state::sStateHash,
                            std::chrono::milliseconds(FLAGS_lb_interval_ms));
 
-    if (!_meta_opts.cold_backup_disabled) {
+    if (!FLAGS_cold_backup_disabled) {
         LOG_INFO("start backup service");
         tasking::enqueue(LPC_DEFAULT_CALLBACK,
                          nullptr,
@@ -319,7 +328,7 @@ error_code meta_service::start()
 
     // start failure detector, and try to acquire the leader lock
     _failure_detector.reset(new meta_server_failure_detector(this));
-    if (_meta_opts.enable_white_list)
+    if (FLAGS_enable_white_list)
         _failure_detector->set_allow_list(_meta_opts.replica_white_list);
     _failure_detector->register_ctrl_commands();
 
@@ -327,11 +336,11 @@ error_code meta_service::start()
                                    FLAGS_fd_beacon_interval_seconds,
                                    FLAGS_fd_lease_seconds,
                                    FLAGS_fd_grace_seconds,
-                                   _meta_opts.enable_white_list);
+                                   FLAGS_enable_white_list);
 
     dreturn_not_ok_logged(err, "start failure_detector failed, err = {}", err);
     LOG_INFO("meta service failure detector is successfully started {}",
-             _meta_opts.enable_white_list ? "with whitelist enabled" : "");
+             FLAGS_enable_white_list ? "with whitelist enabled" : "");
 
     // should register rpc handlers before acquiring leader lock, so that this 
meta service
     // can tell others who is the current leader
@@ -360,7 +369,7 @@ error_code meta_service::start()
 
     // initializing the backup_handler should after remote_storage be 
initialized,
     // because we should use _cluster_root
-    if (!_meta_opts.cold_backup_disabled) {
+    if (!FLAGS_cold_backup_disabled) {
         LOG_INFO("initialize backup handler");
         _backup_handler = std::make_shared<backup_service>(
             this,
@@ -375,7 +384,7 @@ error_code meta_service::start()
     // initialize the server_state
     _state->initialize(this, 
meta_options::concat_path_unix_style(_cluster_root, "apps"));
     while ((err = _state->initialize_data_structure()) != ERR_OK) {
-        if (err == ERR_OBJECT_NOT_FOUND && 
_meta_opts.recover_from_replica_server) {
+        if (err == ERR_OBJECT_NOT_FOUND && FLAGS_recover_from_replica_server) {
             LOG_INFO("can't find apps from remote storage, and "
                      "[meta_server].recover_from_replica_server = true, "
                      "administrator should recover this cluster manually 
later");
@@ -962,7 +971,7 @@ void meta_service::register_duplication_rpc_handlers()
 
 void meta_service::initialize_duplication_service()
 {
-    if (_opts.duplication_enabled) {
+    if (FLAGS_duplication_enabled) {
         _dup_svc = make_unique<meta_duplication_service>(_state.get(), this);
     }
 }
diff --git a/src/meta/server_state.cpp b/src/meta/server_state.cpp
index 1dff37f56..f457c5ce9 100644
--- a/src/meta/server_state.cpp
+++ b/src/meta/server_state.cpp
@@ -58,7 +58,10 @@ using namespace dsn;
 
 namespace dsn {
 namespace replication {
-
+DSN_DEFINE_bool(meta_server,
+                add_secondary_enable_flow_control,
+                false,
+                "enable flow control for add secondary proposal");
 DSN_DEFINE_int32(meta_server,
                  max_allowed_replica_count,
                  5,
@@ -96,6 +99,9 @@ DSN_DEFINE_int32(meta_server,
                  add_secondary_max_count_for_one_node,
                  10,
                  "add secondary max count for one node when flow control 
enabled");
+
+DSN_DECLARE_bool(recover_from_replica_server);
+
 static const char *lock_state = "lock";
 static const char *unlock_state = "unlock";
 
@@ -171,8 +177,7 @@ void server_state::initialize(meta_service *meta_svc, const 
std::string &apps_ro
 {
     _meta_svc = meta_svc;
     _apps_root = apps_root;
-    _add_secondary_enable_flow_control =
-        _meta_svc->get_meta_options().add_secondary_enable_flow_control;
+    _add_secondary_enable_flow_control = 
FLAGS_add_secondary_enable_flow_control;
     _add_secondary_max_count_for_one_node = 
FLAGS_add_secondary_max_count_for_one_node;
 
     _dead_partition_count.init_app_counter("eon.server_state",
@@ -761,14 +766,14 @@ error_code server_state::initialize_data_structure()
 {
     error_code err = sync_apps_from_remote_storage();
     if (err == ERR_OBJECT_NOT_FOUND) {
-        if (_meta_svc->get_meta_options().recover_from_replica_server) {
+        if (FLAGS_recover_from_replica_server) {
             return ERR_OBJECT_NOT_FOUND;
         } else {
             LOG_INFO("can't find apps from remote storage, start to initialize 
default apps");
             err = initialize_default_apps();
         }
     } else if (err == ERR_OK) {
-        if (_meta_svc->get_meta_options().recover_from_replica_server) {
+        if (FLAGS_recover_from_replica_server) {
             CHECK(false,
                   "find apps from remote storage, but "
                   "[meta_server].recover_from_replica_server = true");
diff --git a/src/meta/test/config-test.ini b/src/meta/test/config-test.ini
index e24f4d946..26bf34f75 100644
--- a/src/meta/test/config-test.ini
+++ b/src/meta/test/config-test.ini
@@ -56,9 +56,6 @@ stderr_start_level = LOG_LEVEL_ERROR
 [tools.simulator]
 random_seed = 1465902258
 
-[tools.screen_logger]
-short_header = false
-
 [network]
 ; how many network threads for network library (used by asio)
 io_service_worker_count = 2
diff --git a/src/meta/test/meta_state/config-test.ini 
b/src/meta/test/meta_state/config-test.ini
index 7d438a9ac..f65c817fb 100644
--- a/src/meta/test/meta_state/config-test.ini
+++ b/src/meta/test/meta_state/config-test.ini
@@ -66,9 +66,6 @@ stderr_start_level = LOG_LEVEL_WARNING
 [tools.simulator]
 random_seed = 0
 
-[tools.screen_logger]
-short_header = false
-
 [network]
 ; how many network threads for network library (used by asio)
 io_service_worker_count = 2
diff --git a/src/replica/bulk_load/test/config-test.ini 
b/src/replica/bulk_load/test/config-test.ini
index 40c2bdd57..d9d8fd9da 100644
--- a/src/replica/bulk_load/test/config-test.ini
+++ b/src/replica/bulk_load/test/config-test.ini
@@ -56,9 +56,6 @@ stderr_start_level = LOG_LEVEL_WARNING
 [tools.simulator]
 random_seed = 1465902258
 
-[tools.screen_logger]
-short_header = false
-
 [network]
 ; how many network threads for network library (used by asio)
 io_service_worker_count = 2
diff --git a/src/replica/replica.cpp b/src/replica/replica.cpp
index d19950735..0dfeb4812 100644
--- a/src/replica/replica.cpp
+++ b/src/replica/replica.cpp
@@ -51,6 +51,10 @@
 namespace dsn {
 namespace replication {
 
+DSN_DEFINE_bool(replication,
+                batch_write_disabled,
+                false,
+                "whether to disable auto-batch of replicated write requests");
 DSN_DEFINE_int32(replication,
                  staleness_for_commit,
                  10,
@@ -83,7 +87,7 @@ replica::replica(replica_stub *stub,
     : serverlet<replica>("replica"),
       replica_base(gpid, fmt::format("{}@{}", gpid, 
stub->_primary_address_str), app.app_name),
       _app_info(app),
-      _primary_states(gpid, FLAGS_staleness_for_commit, 
stub->options().batch_write_disabled),
+      _primary_states(gpid, FLAGS_staleness_for_commit, 
FLAGS_batch_write_disabled),
       _potential_secondary_states(this),
       _cold_backup_running_count(0),
       _cold_backup_max_duration_time_ms(0),
diff --git a/src/replica/replica_check.cpp b/src/replica/replica_check.cpp
index 7329eb7d6..17bb0b6e4 100644
--- a/src/replica/replica_check.cpp
+++ b/src/replica/replica_check.cpp
@@ -47,6 +47,7 @@
 
 namespace dsn {
 namespace replication {
+DSN_DEFINE_bool(replication, group_check_disabled, false, "whether group check 
is disabled");
 DSN_DEFINE_int32(replication,
                  group_check_interval_ms,
                  10000,
@@ -62,7 +63,7 @@ void replica::init_group_check()
 
     LOG_INFO_PREFIX("init group check");
 
-    if (partition_status::PS_PRIMARY != status() || 
_options->group_check_disabled)
+    if (partition_status::PS_PRIMARY != status() || FLAGS_group_check_disabled)
         return;
 
     CHECK(nullptr == _primary_states.group_check_task, "");
diff --git a/src/replica/replica_http_service.cpp 
b/src/replica/replica_http_service.cpp
index d9685ef32..03c02bd5a 100644
--- a/src/replica/replica_http_service.cpp
+++ b/src/replica/replica_http_service.cpp
@@ -31,7 +31,7 @@ namespace replication {
 void replica_http_service::query_duplication_handler(const http_request &req, 
http_response &resp)
 {
     if (!_stub->_duplication_sync_timer) {
-        resp.body = "duplication is not enabled [duplication_enabled=false]";
+        resp.body = "duplication is not enabled 
[FLAGS_duplication_enabled=false]";
         resp.status_code = http_status_code::not_found;
         return;
     }
diff --git a/src/replica/replica_init.cpp b/src/replica/replica_init.cpp
index 80ef47e35..b7e932e6c 100644
--- a/src/replica/replica_init.cpp
+++ b/src/replica/replica_init.cpp
@@ -38,7 +38,7 @@
 
 namespace dsn {
 namespace replication {
-
+DSN_DEFINE_bool(replication, checkpoint_disabled, false, "whether checkpoint 
is disabled");
 DSN_DEFINE_int32(replication,
                  checkpoint_interval_seconds,
                  100,
@@ -354,7 +354,7 @@ error_code replica::init_app_and_prepare_list(bool 
create_new)
         }
 
         if (err == ERR_OK) {
-            if (_checkpoint_timer == nullptr && 
!_options->checkpoint_disabled) {
+            if (_checkpoint_timer == nullptr && !FLAGS_checkpoint_disabled) {
                 _checkpoint_timer =
                     tasking::enqueue_timer(LPC_PER_REPLICA_CHECKPOINT_TIMER,
                                            &_tracker,
diff --git a/src/replica/replica_stub.cpp b/src/replica/replica_stub.cpp
index 4e7f6acf7..e38112867 100644
--- a/src/replica/replica_stub.cpp
+++ b/src/replica/replica_stub.cpp
@@ -70,7 +70,39 @@ DSN_DEFINE_bool(replication,
                 ignore_broken_disk,
                 true,
                 "true means ignore broken data disk when initialize");
-
+DSN_DEFINE_bool(replication,
+                deny_client_on_start,
+                false,
+                "whether to deny client read and write requests when starting 
the server");
+DSN_DEFINE_bool(replication,
+                verbose_client_log_on_start,
+                false,
+                "whether to print verbose error log when reply to client read 
and write requests "
+                "when starting the server");
+DSN_DEFINE_bool(replication,
+                mem_release_enabled,
+                true,
+                "whether to enable periodic memory release");
+DSN_DEFINE_bool(replication,
+                log_shared_force_flush,
+                false,
+                "when write shared log, whether to flush file after write 
done");
+DSN_DEFINE_bool(replication, gc_disabled, false, "whether to disable garbage 
collection");
+DSN_DEFINE_bool(replication, disk_stat_disabled, false, "whether to disable 
disk stat");
+DSN_DEFINE_bool(replication,
+                delay_for_fd_timeout_on_start,
+                false,
+                "whether to delay for beacon grace period to make failure 
detector timeout when "
+                "starting the server");
+DSN_DEFINE_bool(replication,
+                config_sync_disabled,
+                false,
+                "whether to disable replica configuration periodical sync with 
the meta server");
+DSN_DEFINE_bool(replication, fd_disabled, false, "whether to disable failure 
detection");
+DSN_DEFINE_bool(replication,
+                verbose_commit_log_on_start,
+                false,
+                "whether to print verbose log when commit mutation when 
starting the server");
 DSN_DEFINE_uint32(replication,
                   max_concurrent_manual_emergency_checkpointing_count,
                   10,
@@ -112,6 +144,7 @@ DSN_DEFINE_int32(
     "if tcmalloc reserved but not-used memory exceed this percentage of 
application allocated "
     "memory, replica server will release the exceeding memory back to 
operating system");
 
+DSN_DECLARE_bool(duplication_enabled);
 DSN_DECLARE_int32(fd_beacon_interval_seconds);
 DSN_DECLARE_int32(fd_check_interval_seconds);
 DSN_DECLARE_int32(fd_grace_seconds);
@@ -517,10 +550,10 @@ void replica_stub::initialize(const replication_options 
&opts, bool clear /* = f
     }
     LOG_INFO("meta_servers = {}", oss.str());
 
-    _deny_client = _options.deny_client_on_start;
-    _verbose_client_log = _options.verbose_client_log_on_start;
-    _verbose_commit_log = _options.verbose_commit_log_on_start;
-    _release_tcmalloc_memory = _options.mem_release_enabled;
+    _deny_client = FLAGS_deny_client_on_start;
+    _verbose_client_log = FLAGS_verbose_client_log_on_start;
+    _verbose_commit_log = FLAGS_verbose_commit_log_on_start;
+    _release_tcmalloc_memory = FLAGS_mem_release_enabled;
     _mem_release_max_reserved_mem_percentage = 
FLAGS_mem_release_max_reserved_mem_percentage;
     _max_concurrent_bulk_load_downloading_count =
         _options.max_concurrent_bulk_load_downloading_count;
@@ -545,7 +578,7 @@ void replica_stub::initialize(const replication_options 
&opts, bool clear /* = f
 
     _log = new mutation_log_shared(_options.slog_dir,
                                    FLAGS_log_shared_file_size_mb,
-                                   _options.log_shared_force_flush,
+                                   FLAGS_log_shared_force_flush,
                                    &_counter_shared_log_recent_write_size);
     LOG_INFO("slog_dir = {}", _options.slog_dir);
 
@@ -672,7 +705,7 @@ void replica_stub::initialize(const replication_options 
&opts, bool clear /* = f
               _options.slog_dir);
         _log = new mutation_log_shared(_options.slog_dir,
                                        FLAGS_log_shared_file_size_mb,
-                                       _options.log_shared_force_flush,
+                                       FLAGS_log_shared_force_flush,
                                        &_counter_shared_log_recent_write_size);
         CHECK_EQ_MSG(_log->open(nullptr, [this](error_code err) { 
this->handle_log_failure(err); }),
                      ERR_OK,
@@ -719,7 +752,7 @@ void replica_stub::initialize(const replication_options 
&opts, bool clear /* = f
     }
 
     // gc
-    if (false == _options.gc_disabled) {
+    if (!FLAGS_gc_disabled) {
         _gc_timer_task = tasking::enqueue_timer(
             LPC_GARBAGE_COLLECT_LOGS_AND_REPLICAS,
             &_tracker,
@@ -730,7 +763,7 @@ void replica_stub::initialize(const replication_options 
&opts, bool clear /* = f
     }
 
     // disk stat
-    if (false == _options.disk_stat_disabled) {
+    if (!FLAGS_disk_stat_disabled) {
         _disk_stat_timer_task =
             ::dsn::tasking::enqueue_timer(LPC_DISK_STAT,
                                           &_tracker,
@@ -752,7 +785,7 @@ void replica_stub::initialize(const replication_options 
&opts, bool clear /* = f
 
     dist::cmd::register_remote_command_rpc();
 
-    if (_options.delay_for_fd_timeout_on_start) {
+    if (FLAGS_delay_for_fd_timeout_on_start) {
         uint64_t now_time_ms = dsn_now_ms();
         uint64_t delay_time_ms =
             (FLAGS_fd_grace_seconds + 3) * 1000; // for more 3 seconds than 
grace seconds
@@ -811,7 +844,7 @@ void replica_stub::initialize_start()
     }
 
     // start timer for configuration sync
-    if (!_options.config_sync_disabled) {
+    if (!FLAGS_config_sync_disabled) {
         _config_sync_timer_task =
             tasking::enqueue_timer(LPC_QUERY_CONFIGURATION_ALL,
                                    &_tracker,
@@ -834,7 +867,7 @@ void replica_stub::initialize_start()
                                
std::chrono::milliseconds(FLAGS_mem_release_check_interval_ms));
 #endif
 
-    if (_options.duplication_enabled) {
+    if (FLAGS_duplication_enabled) {
         _duplication_sync_timer = 
dsn::make_unique<duplication_sync_timer>(this);
         _duplication_sync_timer->start();
     }
@@ -843,7 +876,7 @@ void replica_stub::initialize_start()
 
     // init liveness monitor
     CHECK_EQ(NS_Disconnected, _state);
-    if (!_options.fd_disabled) {
+    if (!FLAGS_fd_disabled) {
         _failure_detector = 
std::make_shared<dsn::dist::slave_failure_detector_with_multimaster>(
             _options.meta_servers,
             [this]() { this->on_meta_server_disconnected(); },
@@ -1675,7 +1708,7 @@ void replica_stub::response_client(gpid id,
 
 void replica_stub::init_gc_for_test()
 {
-    CHECK(_options.gc_disabled, "");
+    CHECK(FLAGS_gc_disabled, "");
 
     _gc_timer_task = tasking::enqueue(LPC_GARBAGE_COLLECT_LOGS_AND_REPLICAS,
                                       &_tracker,
diff --git a/src/replica/split/test/config-test.ini 
b/src/replica/split/test/config-test.ini
index 9b48d879f..ca0550f48 100644
--- a/src/replica/split/test/config-test.ini
+++ b/src/replica/split/test/config-test.ini
@@ -56,9 +56,6 @@ stderr_start_level = LOG_LEVEL_WARNING
 [tools.simulator]
 random_seed = 1465902258
 
-[tools.screen_logger]
-short_header = false
-
 [network]
 ; how many network threads for network library (used by asio)
 io_service_worker_count = 2
diff --git a/src/replica/storage/simple_kv/simple_kv.server.impl.cpp 
b/src/replica/storage/simple_kv/simple_kv.server.impl.cpp
index 9d5962a9f..91f755f06 100644
--- a/src/replica/storage/simple_kv/simple_kv.server.impl.cpp
+++ b/src/replica/storage/simple_kv/simple_kv.server.impl.cpp
@@ -48,11 +48,7 @@ simple_kv_service_impl::simple_kv_service_impl(replica *r) : 
simple_kv_service(r
     LOG_INFO("simple_kv_service_impl inited");
 }
 
-void simple_kv_service_impl::reset_state()
-{
-    _test_file_learning = dsn_config_get_value_bool("test", 
"test_file_learning", true, "");
-    _last_durable_decree = 0;
-}
+void simple_kv_service_impl::reset_state() { _last_durable_decree = 0; }
 
 // RPC_SIMPLE_KV_READ
 void simple_kv_service_impl::on_read(const std::string &key, 
::dsn::rpc_replier<std::string> &reply)
diff --git a/src/replica/storage/simple_kv/simple_kv.server.impl.h 
b/src/replica/storage/simple_kv/simple_kv.server.impl.h
index db3b34530..58bd63b29 100644
--- a/src/replica/storage/simple_kv/simple_kv.server.impl.h
+++ b/src/replica/storage/simple_kv/simple_kv.server.impl.h
@@ -109,7 +109,6 @@ private:
     typedef std::map<std::string, std::string> simple_kv;
     zlock _lock;
     simple_kv _store;
-    bool _test_file_learning;
     int64_t _last_durable_decree;
 };
 }
diff --git a/src/replica/storage/simple_kv/test/simple_kv.server.impl.cpp 
b/src/replica/storage/simple_kv/test/simple_kv.server.impl.cpp
index b1e571faa..5ece64096 100644
--- a/src/replica/storage/simple_kv/test/simple_kv.server.impl.cpp
+++ b/src/replica/storage/simple_kv/test/simple_kv.server.impl.cpp
@@ -45,11 +45,7 @@ simple_kv_service_impl::simple_kv_service_impl(replica *r) : 
simple_kv_service(r
     LOG_INFO("simple_kv_service_impl inited");
 }
 
-void simple_kv_service_impl::reset_state()
-{
-    _test_file_learning = dsn_config_get_value_bool("test", 
"test_file_learning", true, "");
-    _last_durable_decree = 0;
-}
+void simple_kv_service_impl::reset_state() { _last_durable_decree = 0; }
 
 // RPC_SIMPLE_KV_READ
 void simple_kv_service_impl::on_read(const std::string &key, 
::dsn::rpc_replier<std::string> &reply)
diff --git a/src/replica/storage/simple_kv/test/simple_kv.server.impl.h 
b/src/replica/storage/simple_kv/test/simple_kv.server.impl.h
index 1d04367d3..69a05040a 100644
--- a/src/replica/storage/simple_kv/test/simple_kv.server.impl.h
+++ b/src/replica/storage/simple_kv/test/simple_kv.server.impl.h
@@ -109,7 +109,6 @@ private:
     typedef std::map<std::string, std::string> simple_kv;
     simple_kv _store;
     ::dsn::zlock _lock;
-    bool _test_file_learning;
 
     int64_t _last_durable_decree;
 };
diff --git a/src/replica/test/config-test.ini b/src/replica/test/config-test.ini
index d45260265..1a1997cc9 100644
--- a/src/replica/test/config-test.ini
+++ b/src/replica/test/config-test.ini
@@ -56,9 +56,6 @@ stderr_start_level = LOG_LEVEL_WARNING
 [tools.simulator]
 random_seed = 1465902258
 
-[tools.screen_logger]
-short_header = false
-
 [network]
 ; how many network threads for network library (used by asio)
 io_service_worker_count = 2
diff --git a/src/replica/test/replica_http_service_test.cpp 
b/src/replica/test/replica_http_service_test.cpp
index 15bb165eb..f0ffa2170 100644
--- a/src/replica/test/replica_http_service_test.cpp
+++ b/src/replica/test/replica_http_service_test.cpp
@@ -27,7 +27,8 @@ using std::string;
 
 namespace dsn {
 namespace replication {
-
+DSN_DECLARE_bool(duplication_enabled);
+DSN_DECLARE_bool(fd_disabled);
 DSN_DECLARE_uint32(config_sync_interval_ms);
 
 class replica_http_service_test : public replica_test_base
@@ -36,8 +37,8 @@ public:
     replica_http_service_test()
     {
         // Disable unnecessary works before starting stub.
-        stub->_options.fd_disabled = true;
-        stub->_options.duplication_enabled = false;
+        FLAGS_fd_disabled = true;
+        FLAGS_duplication_enabled = false;
         stub->initialize_start();
 
         http_call_registry::instance().clear_paths();
diff --git a/src/runtime/profiler.cpp b/src/runtime/profiler.cpp
index b83906ffa..daff4c7e5 100644
--- a/src/runtime/profiler.cpp
+++ b/src/runtime/profiler.cpp
@@ -58,10 +58,18 @@ START<== queue(server) == ENQUEUE <===== net(reply) ======= 
REPLY <=============
 #include "utils/command_manager.h"
 #include "perf_counter/perf_counter_wrapper.h"
 #include "utils/fmt_logging.h"
+#include "utils/flags.h"
 
 namespace dsn {
 namespace tools {
 
+DSN_DEFINE_bool(task..default, is_profile, false, "whether to profile this 
kind of task");
+DSN_DEFINE_bool(task..default,
+                collect_call_count,
+                true,
+                "whether to collect how many time this kind of tasks invoke 
each of other kinds "
+                "tasks");
+
 typedef uint64_extension_helper<task_spec_profiler, task> 
task_ext_for_profiler;
 typedef uint64_extension_helper<task_spec_profiler, message_ex> 
message_ext_for_profiler;
 
@@ -352,14 +360,6 @@ void profiler::install(service_spec &)
     message_ext_for_profiler::register_ext();
     CHECK_EQ(sizeof(counter_info_ptr) / sizeof(counter_info *), 
PERF_COUNTER_COUNT);
 
-    auto profile = dsn_config_get_value_bool(
-        "task..default", "is_profile", false, "whether to profile this kind of 
task");
-    auto collect_call_count = dsn_config_get_value_bool(
-        "task..default",
-        "collect_call_count",
-        true,
-        "whether to collect how many time this kind of tasks invoke each of 
other kinds tasks");
-
     for (int i = 0; i <= s_task_code_max; i++) {
         if (i == TASK_CODE_INVALID)
             continue;
@@ -372,15 +372,18 @@ void profiler::install(service_spec &)
         s_spec_profilers[i].collect_call_count = dsn_config_get_value_bool(
             section_name.c_str(),
             "collect_call_count",
-            collect_call_count,
+            FLAGS_collect_call_count,
             "whether to collect how many time this kind of tasks invoke each 
of other kinds tasks");
         s_spec_profilers[i].call_counts = new std::atomic<int64_t>[ 
s_task_code_max + 1 ];
         std::fill(s_spec_profilers[i].call_counts,
                   s_spec_profilers[i].call_counts + s_task_code_max + 1,
                   0);
 
-        s_spec_profilers[i].is_profile = dsn_config_get_value_bool(
-            section_name.c_str(), "is_profile", profile, "whether to profile 
this kind of task");
+        s_spec_profilers[i].is_profile =
+            dsn_config_get_value_bool(section_name.c_str(),
+                                      "is_profile",
+                                      FLAGS_is_profile,
+                                      "whether to profile this kind of task");
 
         if (!s_spec_profilers[i].is_profile)
             continue;
diff --git a/src/runtime/service_api_c.cpp b/src/runtime/service_api_c.cpp
index 87dc1d94c..6ea71e5f3 100644
--- a/src/runtime/service_api_c.cpp
+++ b/src/runtime/service_api_c.cpp
@@ -50,6 +50,11 @@
 #include "utils/time_utils.h"
 #include "utils/process_utils.h"
 
+DSN_DEFINE_bool(core,
+                pause_on_start,
+                false,
+                "whether to pause at startup time for easier debugging");
+
 #ifdef DSN_ENABLE_GPERF
 DSN_DEFINE_double(core,
                   tcmalloc_release_rate,
@@ -372,10 +377,7 @@ bool run(const char *config_file,
     dsn_all.magic = 0xdeadbeef;
 
     // pause when necessary
-    if (dsn_config_get_value_bool("core",
-                                  "pause_on_start",
-                                  false,
-                                  "whether to pause at startup time for easier 
debugging")) {
+    if (FLAGS_pause_on_start) {
         printf("\nPause for debugging (pid = %d)...\n", 
static_cast<int>(getpid()));
         getchar();
     }
diff --git a/src/runtime/tracer.cpp b/src/runtime/tracer.cpp
index 320591086..e59aca99c 100644
--- a/src/runtime/tracer.cpp
+++ b/src/runtime/tracer.cpp
@@ -29,10 +29,13 @@
 #include "aio/aio_task.h"
 #include "utils/filesystem.h"
 #include "utils/command_manager.h"
+#include "utils/flags.h"
 
 namespace dsn {
 namespace tools {
 
+DSN_DEFINE_bool(task..default, is_trace, false, "whether to trace tasks by 
default");
+
 static void tracer_on_task_create(task *caller, task *callee)
 {
     dsn_task_type_t type = callee->spec().type;
@@ -278,9 +281,6 @@ static std::string tracer_log_flow(const 
std::vector<std::string> &args)
 
 void tracer::install(service_spec &spec)
 {
-    auto trace = dsn_config_get_value_bool(
-        "task..default", "is_trace", false, "whether to trace tasks by 
default");
-
     for (int i = 0; i <= dsn::task_code::max(); i++) {
         if (i == TASK_CODE_INVALID)
             continue;
@@ -290,8 +290,10 @@ void tracer::install(service_spec &spec)
         task_spec *spec = task_spec::get(i);
         CHECK_NOTNULL(spec, "");
 
-        if (!dsn_config_get_value_bool(
-                section_name.c_str(), "is_trace", trace, "whether to trace 
this kind of task"))
+        if (!dsn_config_get_value_bool(section_name.c_str(),
+                                       "is_trace",
+                                       FLAGS_is_trace,
+                                       "whether to trace this kind of task"))
             continue;
 
         if (dsn_config_get_value_bool(section_name.c_str(),
diff --git a/src/server/pegasus_server_impl.cpp 
b/src/server/pegasus_server_impl.cpp
index 4deafe27e..c655d7273 100644
--- a/src/server/pegasus_server_impl.cpp
+++ b/src/server/pegasus_server_impl.cpp
@@ -57,6 +57,10 @@ DSN_DECLARE_uint32(checkpoint_reserve_time_seconds);
 DSN_DECLARE_uint64(rocksdb_iteration_threshold_time_ms);
 DSN_DECLARE_uint64(rocksdb_slow_query_threshold_ns);
 
+DSN_DEFINE_bool(pegasus.server,
+                rocksdb_verbose_log,
+                false,
+                "whether to print verbose log for debugging");
 DSN_DEFINE_int32(pegasus.server,
                  hotkey_analyse_time_interval_s,
                  10,
@@ -293,7 +297,7 @@ void pegasus_server_impl::on_get(get_rpc rpc)
     if (status.ok()) {
         if (check_if_record_expired(utils::epoch_now(), value)) {
             _pfc_recent_expire_count->increment();
-            if (_verbose_log) {
+            if (FLAGS_rocksdb_verbose_log) {
                 LOG_ERROR_PREFIX("rocksdb data expired for get from {}", 
rpc.remote_address());
             }
             status = rocksdb::Status::NotFound();
@@ -301,7 +305,7 @@ void pegasus_server_impl::on_get(get_rpc rpc)
     }
 
     if (!status.ok()) {
-        if (_verbose_log) {
+        if (FLAGS_rocksdb_verbose_log) {
             ::dsn::blob hash_key, sort_key;
             pegasus_restore_key(key, hash_key, sort_key);
             LOG_ERROR_PREFIX("rocksdb get failed for get from {}: hash_key = 
\"{}\", sort_key = "
@@ -439,7 +443,7 @@ void pegasus_server_impl::on_multi_get(multi_get_rpc rpc)
         int c = start.compare(stop);
         if (c > 0 || (c == 0 && (!start_inclusive || !stop_inclusive))) {
             // empty sort key range
-            if (_verbose_log) {
+            if (FLAGS_rocksdb_verbose_log) {
                 LOG_WARNING_PREFIX(
                     "empty sort key range for multi_get from {}: hash_key = 
\"{}\", start_sort_key "
                     "= \"{}\" ({}), stop_sort_key = \"{}\" ({}), 
sort_key_filter_type = {}, "
@@ -619,7 +623,7 @@ void pegasus_server_impl::on_multi_get(multi_get_rpc rpc)
         resp.error = it->status().code();
         if (!it->status().ok()) {
             // error occur
-            if (_verbose_log) {
+            if (FLAGS_rocksdb_verbose_log) {
                 LOG_ERROR_PREFIX("rocksdb scan failed for multi_get from {}: 
hash_key = \"{}\", "
                                  "reverse = {}, error = {}",
                                  rpc.remote_address(),
@@ -667,7 +671,7 @@ void pegasus_server_impl::on_multi_get(multi_get_rpc rpc)
             std::string &value = values[i];
             // print log
             if (!status.ok()) {
-                if (_verbose_log) {
+                if (FLAGS_rocksdb_verbose_log) {
                     LOG_ERROR_PREFIX("rocksdb get failed for multi_get from 
{}: hash_key = \"{}\", "
                                      "sort_key = \"{}\", error = {}",
                                      rpc.remote_address(),
@@ -685,7 +689,7 @@ void pegasus_server_impl::on_multi_get(multi_get_rpc rpc)
                 uint32_t expire_ts = 
pegasus_extract_expire_ts(_pegasus_data_version, value);
                 if (expire_ts > 0 && expire_ts <= epoch_now) {
                     expire_count++;
-                    if (_verbose_log) {
+                    if (FLAGS_rocksdb_verbose_log) {
                         LOG_ERROR_PREFIX("rocksdb data expired for multi_get 
from {}",
                                          rpc.remote_address());
                     }
@@ -828,7 +832,7 @@ void pegasus_server_impl::on_batch_get(batch_get_rpc rpc)
 
         if (dsn_likely(status.ok())) {
             if (check_if_record_expired(epoch_now, value)) {
-                if (_verbose_log) {
+                if (FLAGS_rocksdb_verbose_log) {
                     LOG_ERROR_PREFIX(
                         "rocksdb data expired for batch_get from {}, hash_key 
= {}, sort_key = {}",
                         rpc.remote_address().to_string(),
@@ -847,7 +851,7 @@ void pegasus_server_impl::on_batch_get(batch_get_rpc rpc)
             total_data_size += current_data.value.size();
             response.data.emplace_back(std::move(current_data));
         } else {
-            if (_verbose_log) {
+            if (FLAGS_rocksdb_verbose_log) {
                 LOG_ERROR_PREFIX(
                     "rocksdb get failed for batch_get from {}:  error = {}, 
key size = {}",
                     rpc.remote_address().to_string(),
@@ -929,7 +933,7 @@ void 
pegasus_server_impl::on_sortkey_count(sortkey_count_rpc rpc)
 
         if (check_if_record_expired(epoch_now, it->value())) {
             expire_count++;
-            if (_verbose_log) {
+            if (FLAGS_rocksdb_verbose_log) {
                 LOG_ERROR_PREFIX("rocksdb data expired for sortkey_count from 
{}",
                                  rpc.remote_address());
             }
@@ -945,7 +949,7 @@ void 
pegasus_server_impl::on_sortkey_count(sortkey_count_rpc rpc)
     resp.error = it->status().code();
     if (!it->status().ok()) {
         // error occur
-        if (_verbose_log) {
+        if (FLAGS_rocksdb_verbose_log) {
             LOG_ERROR_PREFIX(
                 "rocksdb scan failed for sortkey_count from {}: hash_key = 
\"{}\", error = {}",
                 rpc.remote_address(),
@@ -995,7 +999,7 @@ void pegasus_server_impl::on_ttl(ttl_rpc rpc)
         expire_ts = pegasus_extract_expire_ts(_pegasus_data_version, value);
         if (check_if_ts_expired(now_ts, expire_ts)) {
             _pfc_recent_expire_count->increment();
-            if (_verbose_log) {
+            if (FLAGS_rocksdb_verbose_log) {
                 LOG_ERROR_PREFIX("rocksdb data expired for ttl from {}", 
rpc.remote_address());
             }
             status = rocksdb::Status::NotFound();
@@ -1003,7 +1007,7 @@ void pegasus_server_impl::on_ttl(ttl_rpc rpc)
     }
 
     if (!status.ok()) {
-        if (_verbose_log) {
+        if (FLAGS_rocksdb_verbose_log) {
             ::dsn::blob hash_key, sort_key;
             pegasus_restore_key(key, hash_key, sort_key);
             LOG_ERROR_PREFIX("rocksdb get failed for ttl from {}: hash_key = 
\"{}\", sort_key = "
@@ -1115,7 +1119,7 @@ void pegasus_server_impl::on_get_scanner(get_scanner_rpc 
rpc)
     int c = start.compare(stop);
     if (c > 0 || (c == 0 && (!start_inclusive || !stop_inclusive))) {
         // empty key range
-        if (_verbose_log) {
+        if (FLAGS_rocksdb_verbose_log) {
             LOG_WARNING_PREFIX("empty key range for get_scanner from {}: 
start_key = \"{}\" ({}), "
                                "stop_key = \"{}\" ({})",
                                rpc.remote_address(),
@@ -1221,7 +1225,7 @@ void pegasus_server_impl::on_get_scanner(get_scanner_rpc 
rpc)
     resp.error = it->status().code();
     if (!it->status().ok()) {
         // error occur
-        if (_verbose_log) {
+        if (FLAGS_rocksdb_verbose_log) {
             LOG_ERROR_PREFIX("rocksdb scan failed for get_scanner from {}: 
start_key = \"{}\" "
                              "({}), stop_key = \"{}\" ({}), batch_size = {}, 
read_count = {}, "
                              "error = {}",
@@ -1392,7 +1396,7 @@ void pegasus_server_impl::on_scan(scan_rpc rpc)
         resp.error = it->status().code();
         if (!it->status().ok()) {
             // error occur
-            if (_verbose_log) {
+            if (FLAGS_rocksdb_verbose_log) {
                 LOG_ERROR_PREFIX("rocksdb scan failed for scan from {}: 
context_id= {}, stop_key = "
                                  "\"{}\" ({}), batch_size = {}, read_count = 
{}, error = {}",
                                  rpc.remote_address(),
@@ -1720,7 +1724,7 @@ dsn::error_code pegasus_server_impl::start(int argc, char 
**argv)
     // initialize cu calculator and write service after server being 
initialized.
     _cu_calculator = dsn::make_unique<capacity_unit_calculator>(
         this, _read_hotkey_collector, _write_hotkey_collector, 
_read_size_throttling_controller);
-    _server_write = dsn::make_unique<pegasus_server_write>(this, _verbose_log);
+    _server_write = dsn::make_unique<pegasus_server_write>(this);
 
     dsn::tasking::enqueue_timer(LPC_ANALYZE_HOTKEY,
                                 &_tracker,
@@ -2250,7 +2254,7 @@ range_iteration_state 
pegasus_server_impl::validate_key_value_for_scan(
     bool request_validate_hash)
 {
     if (check_if_record_expired(epoch_now, value)) {
-        if (_verbose_log) {
+        if (FLAGS_rocksdb_verbose_log) {
             LOG_ERROR_PREFIX("rocksdb data expired for scan");
         }
         return range_iteration_state::kExpired;
@@ -2259,7 +2263,7 @@ range_iteration_state 
pegasus_server_impl::validate_key_value_for_scan(
     if (request_validate_hash && _validate_partition_hash) {
         if (_partition_version < 0 || _gpid.get_partition_index() > 
_partition_version ||
             !check_pegasus_key_hash(key, _gpid.get_partition_index(), 
_partition_version)) {
-            if (_verbose_log) {
+            if (FLAGS_rocksdb_verbose_log) {
                 LOG_ERROR_PREFIX("not serve hash key while scan");
             }
             return range_iteration_state::kHashInvalid;
@@ -2274,14 +2278,14 @@ range_iteration_state 
pegasus_server_impl::validate_key_value_for_scan(
         pegasus_restore_key(raw_key, hash_key, sort_key);
         if (hash_key_filter_type != ::dsn::apps::filter_type::FT_NO_FILTER &&
             !validate_filter(hash_key_filter_type, hash_key_filter_pattern, 
hash_key)) {
-            if (_verbose_log) {
+            if (FLAGS_rocksdb_verbose_log) {
                 LOG_ERROR_PREFIX("hash key filtered for scan");
             }
             return range_iteration_state::kFiltered;
         }
         if (sort_key_filter_type != ::dsn::apps::filter_type::FT_NO_FILTER &&
             !validate_filter(sort_key_filter_type, sort_key_filter_pattern, 
sort_key)) {
-            if (_verbose_log) {
+            if (FLAGS_rocksdb_verbose_log) {
                 LOG_ERROR_PREFIX("sort key filtered for scan");
             }
             return range_iteration_state::kFiltered;
@@ -2329,7 +2333,7 @@ range_iteration_state 
pegasus_server_impl::append_key_value_for_multi_get(
     bool no_value)
 {
     if (check_if_record_expired(epoch_now, value)) {
-        if (_verbose_log) {
+        if (FLAGS_rocksdb_verbose_log) {
             LOG_ERROR_PREFIX("rocksdb data expired for multi get");
         }
         return range_iteration_state::kExpired;
@@ -2344,7 +2348,7 @@ range_iteration_state 
pegasus_server_impl::append_key_value_for_multi_get(
 
     if (sort_key_filter_type != ::dsn::apps::filter_type::FT_NO_FILTER &&
         !validate_filter(sort_key_filter_type, sort_key_filter_pattern, 
sort_key)) {
-        if (_verbose_log) {
+        if (FLAGS_rocksdb_verbose_log) {
             LOG_ERROR_PREFIX("sort key filtered for multi get");
         }
         return range_iteration_state::kFiltered;
diff --git a/src/server/pegasus_server_impl.h b/src/server/pegasus_server_impl.h
index c7625201b..82e381681 100644
--- a/src/server/pegasus_server_impl.h
+++ b/src/server/pegasus_server_impl.h
@@ -420,7 +420,6 @@ private:
 
     dsn::gpid _gpid;
     std::string _primary_address;
-    bool _verbose_log;
     // slow query time threshold. exceed this threshold will be logged.
     uint64_t _slow_query_threshold_ns;
 
diff --git a/src/server/pegasus_server_impl_init.cpp 
b/src/server/pegasus_server_impl_init.cpp
index 25c37062a..1d407ae1b 100644
--- a/src/server/pegasus_server_impl_init.cpp
+++ b/src/server/pegasus_server_impl_init.cpp
@@ -95,7 +95,60 @@ DSN_DEFINE_bool(pegasus.server,
                 rocksdb_limiter_enable_auto_tune,
                 false,
                 "whether to enable write rate auto tune when open rocksdb 
write limit");
-
+DSN_DEFINE_bool(pegasus.server,
+                rocksdb_use_direct_reads,
+                false,
+                "rocksdb options.use_direct_reads");
+DSN_DEFINE_bool(pegasus.server,
+                rocksdb_use_direct_io_for_flush_and_compaction,
+                false,
+                "rocksdb options.use_direct_io_for_flush_and_compaction");
+DSN_DEFINE_bool(pegasus.server,
+                rocksdb_disable_table_block_cache,
+                false,
+                "rocksdb tbl_opts.no_block_cache");
+DSN_DEFINE_bool(pegasus.server,
+                rocksdb_enable_write_buffer_manager,
+                false,
+                "enable write buffer manager to limit total memory used by 
memtables and block "
+                "caches across multiple replicas");
+DSN_DEFINE_bool(pegasus.server,
+                rocksdb_partition_filters,
+                false,
+                "Note: currently this option requires two_level_index_search 
to be set as well. "
+                "Use partitioned full filters for each SST file. This option 
is incompatibile with "
+                "block-based filters.");
+DSN_DEFINE_bool(pegasus.server,
+                rocksdb_cache_index_and_filter_blocks,
+                false,
+                "Indicating if we'd put index/filter blocks to the block 
cache. If not specified, "
+                "each \"table reader\" object will pre-load index/filter block 
during table "
+                "initialization.");
+DSN_DEFINE_bool(pegasus.server,
+                rocksdb_pin_top_level_index_and_filter,
+                true,
+                "If cache_index_and_filter_blocks is true and the below is 
true, then the "
+                "top-level index of partitioned filter and index blocks are 
stored in the cache, "
+                "but a reference is held in the \"table reader\" object so the 
blocks are pinned "
+                "and only evicted from cache when the table reader is freed. 
This is not limited "
+                "to l0 in LSM tree.");
+DSN_DEFINE_bool(pegasus.server,
+                rocksdb_cache_index_and_filter_blocks_with_high_priority,
+                true,
+                "If cache_index_and_filter_blocks is enabled, cache index and 
filter blocks with "
+                "high priority. If set to true, depending on implementation of 
block cache, index "
+                "and filter blocks may be less likely to be evicted than data 
blocks.");
+DSN_DEFINE_bool(pegasus.server,
+                rocksdb_pin_l0_filter_and_index_blocks_in_cache,
+                false,
+                "if cache_index_and_filter_blocks is true and the below is 
true, then filter and "
+                "index blocks are stored in the cache, but a reference is held 
in the \"table "
+                "reader\" object so the blocks are pinned and only evicted 
from cache when the "
+                "table reader is freed.");
+DSN_DEFINE_bool(pegasus.server,
+                rocksdb_disable_bloom_filter,
+                false,
+                "Whether to disable bloom filter");
 // If used, For every data block we load into memory, we will create a bitmap
 // of size ((block_size / `read_amp_bytes_per_bit`) / 8) bytes. This bitmap
 // will be used to figure out the percentage we actually read of the blocks.
@@ -312,11 +365,6 @@ 
pegasus_server_impl::pegasus_server_impl(dsn::replication::replica *r)
 
     _read_size_throttling_controller =
         std::make_shared<dsn::utils::token_bucket_throttling_controller>();
-
-    _verbose_log = dsn_config_get_value_bool("pegasus.server",
-                                             "rocksdb_verbose_log",
-                                             false,
-                                             "whether to print verbose log for 
debugging");
     _slow_query_threshold_ns = FLAGS_rocksdb_slow_query_threshold_ns;
     _rng_rd_opts.multi_get_max_iteration_count = 
FLAGS_rocksdb_multi_get_max_iteration_count;
     _rng_rd_opts.multi_get_max_iteration_size = 
FLAGS_rocksdb_multi_get_max_iteration_size;
@@ -328,15 +376,9 @@ 
pegasus_server_impl::pegasus_server_impl(dsn::replication::replica *r)
     // atomic flush data CF and meta CF, aim to keep consistency of 'last 
flushed decree' in meta CF
     // and data in data CF.
     _db_opts.atomic_flush = true;
-
-    _db_opts.use_direct_reads = dsn_config_get_value_bool(
-        "pegasus.server", "rocksdb_use_direct_reads", false, "rocksdb 
options.use_direct_reads");
-
+    _db_opts.use_direct_reads = FLAGS_rocksdb_use_direct_reads;
     _db_opts.use_direct_io_for_flush_and_compaction =
-        dsn_config_get_value_bool("pegasus.server",
-                                  
"rocksdb_use_direct_io_for_flush_and_compaction",
-                                  false,
-                                  "rocksdb 
options.use_direct_io_for_flush_and_compaction");
+        FLAGS_rocksdb_use_direct_io_for_flush_and_compaction;
     _db_opts.compaction_readahead_size = 
FLAGS_rocksdb_compaction_readahead_size;
     _db_opts.writable_file_max_buffer_size = 
FLAGS_rocksdb_writable_file_max_buffer_size;
 
@@ -384,10 +426,7 @@ 
pegasus_server_impl::pegasus_server_impl(dsn::replication::replica *r)
     rocksdb::BlockBasedTableOptions tbl_opts;
     tbl_opts.read_amp_bytes_per_bit = FLAGS_read_amp_bytes_per_bit;
 
-    if (dsn_config_get_value_bool("pegasus.server",
-                                  "rocksdb_disable_table_block_cache",
-                                  false,
-                                  "rocksdb tbl_opts.no_block_cache")) {
+    if (FLAGS_rocksdb_disable_table_block_cache) {
         tbl_opts.no_block_cache = true;
         tbl_opts.block_restart_interval = 4;
     } else {
@@ -421,14 +460,9 @@ 
pegasus_server_impl::pegasus_server_impl(dsn::replication::replica *r)
         _db_opts.rate_limiter = _s_rate_limiter;
     }
 
-    bool enable_write_buffer_manager =
-        dsn_config_get_value_bool("pegasus.server",
-                                  "rocksdb_enable_write_buffer_manager",
-                                  false,
-                                  "enable write buffer manager to limit total 
memory "
-                                  "used by memtables and block caches across 
multiple replicas");
-    LOG_INFO_PREFIX("rocksdb_enable_write_buffer_manager = {}", 
enable_write_buffer_manager);
-    if (enable_write_buffer_manager) {
+    LOG_INFO_PREFIX("rocksdb_enable_write_buffer_manager = {}",
+                    FLAGS_rocksdb_enable_write_buffer_manager);
+    if (FLAGS_rocksdb_enable_write_buffer_manager) {
         // If write buffer manager is enabled, all replicas(one DB instance 
for each
         // replica) on this server will share the same write buffer manager 
object,
         // thus the same block cache object. It's convenient to control the 
total memory
@@ -472,66 +506,33 @@ 
pegasus_server_impl::pegasus_server_impl(dsn::replication::replica *r)
     tbl_opts.index_type = index_type_item->second;
     LOG_INFO_PREFIX("rocksdb_index_type = {}", index_type.c_str());
 
-    tbl_opts.partition_filters = dsn_config_get_value_bool(
-        "pegasus.server",
-        "rocksdb_partition_filters",
-        false,
-        "Note: currently this option requires two_level_index_search to be set 
as well. "
-        "Use partitioned full filters for each SST file. This option is "
-        "incompatibile with block-based filters.");
+    tbl_opts.partition_filters = FLAGS_rocksdb_partition_filters;
+    // TODO(yingchun): clean up these useless log ?
     LOG_INFO_PREFIX("rocksdb_partition_filters = {}", 
tbl_opts.partition_filters);
 
     tbl_opts.metadata_block_size = FLAGS_rocksdb_metadata_block_size;
     LOG_INFO_PREFIX("rocksdb_metadata_block_size = {}", 
tbl_opts.metadata_block_size);
 
-    tbl_opts.cache_index_and_filter_blocks = dsn_config_get_value_bool(
-        "pegasus.server",
-        "rocksdb_cache_index_and_filter_blocks",
-        false,
-        "Indicating if we'd put index/filter blocks to the block cache. "
-        "If not specified, each \"table reader\" object will pre-load 
index/filter "
-        "block during table initialization.");
+    tbl_opts.cache_index_and_filter_blocks = 
FLAGS_rocksdb_cache_index_and_filter_blocks;
     LOG_INFO_PREFIX("rocksdb_cache_index_and_filter_blocks = {}",
                     tbl_opts.cache_index_and_filter_blocks);
 
-    tbl_opts.pin_top_level_index_and_filter = dsn_config_get_value_bool(
-        "pegasus.server",
-        "rocksdb_pin_top_level_index_and_filter",
-        true,
-        "If cache_index_and_filter_blocks is true and the below is true, then "
-        "the top-level index of partitioned filter and index blocks are stored 
in "
-        "the cache, but a reference is held in the \"table reader\" object so 
the "
-        "blocks are pinned and only evicted from cache when the table reader 
is "
-        "freed. This is not limited to l0 in LSM tree.");
+    tbl_opts.pin_top_level_index_and_filter = 
FLAGS_rocksdb_pin_top_level_index_and_filter;
     LOG_INFO_PREFIX("rocksdb_pin_top_level_index_and_filter = {}",
                     tbl_opts.pin_top_level_index_and_filter);
 
-    tbl_opts.cache_index_and_filter_blocks_with_high_priority = 
dsn_config_get_value_bool(
-        "pegasus.server",
-        "rocksdb_cache_index_and_filter_blocks_with_high_priority",
-        true,
-        "If cache_index_and_filter_blocks is enabled, cache index and filter "
-        "blocks with high priority. If set to true, depending on 
implementation of "
-        "block cache, index and filter blocks may be less likely to be evicted 
"
-        "than data blocks.");
+    tbl_opts.cache_index_and_filter_blocks_with_high_priority =
+        FLAGS_rocksdb_cache_index_and_filter_blocks_with_high_priority;
     LOG_INFO_PREFIX("rocksdb_cache_index_and_filter_blocks_with_high_priority 
= {}",
                     tbl_opts.cache_index_and_filter_blocks_with_high_priority);
 
-    tbl_opts.pin_l0_filter_and_index_blocks_in_cache = 
dsn_config_get_value_bool(
-        "pegasus.server",
-        "rocksdb_pin_l0_filter_and_index_blocks_in_cache",
-        false,
-        "if cache_index_and_filter_blocks is true and the below is true, then "
-        "filter and index blocks are stored in the cache, but a reference is "
-        "held in the \"table reader\" object so the blocks are pinned and only 
"
-        "evicted from cache when the table reader is freed.");
+    tbl_opts.pin_l0_filter_and_index_blocks_in_cache =
+        FLAGS_rocksdb_pin_l0_filter_and_index_blocks_in_cache;
     LOG_INFO_PREFIX("rocksdb_pin_l0_filter_and_index_blocks_in_cache = {}",
                     tbl_opts.pin_l0_filter_and_index_blocks_in_cache);
 
     // Bloom filter configurations.
-    bool disable_bloom_filter = dsn_config_get_value_bool(
-        "pegasus.server", "rocksdb_disable_bloom_filter", false, "Whether to 
disable bloom filter");
-    if (!disable_bloom_filter) {
+    if (!FLAGS_rocksdb_disable_bloom_filter) {
         // average bits allocated per key in bloom filter.
         // FLAGS_rocksdb_bloom_filter_bits_per_key    |           false 
positive rate
         // 
-------------------------------------------+-------------------------------------------
diff --git a/src/server/pegasus_server_write.cpp 
b/src/server/pegasus_server_write.cpp
index a96b2b8fb..50ebe596a 100644
--- a/src/server/pegasus_server_write.cpp
+++ b/src/server/pegasus_server_write.cpp
@@ -29,9 +29,10 @@
 
 namespace pegasus {
 namespace server {
+DSN_DECLARE_bool(rocksdb_verbose_log);
 
-pegasus_server_write::pegasus_server_write(pegasus_server_impl *server, bool 
verbose_log)
-    : replica_base(server), _write_svc(new pegasus_write_service(server)), 
_verbose_log(verbose_log)
+pegasus_server_write::pegasus_server_write(pegasus_server_impl *server)
+    : replica_base(server), _write_svc(new pegasus_write_service(server))
 {
     char name[256];
     snprintf(name, 255, "recent_corrupt_write_count@%s", 
get_gpid().to_string());
@@ -146,7 +147,7 @@ void pegasus_server_write::request_key_check(int64_t decree,
         CHECK_EQ_MSG(msg->header->client.thread_hash, thread_hash, 
"inconsistent thread hash");
     }
 
-    if (_verbose_log) {
+    if (FLAGS_rocksdb_verbose_log) {
         ::dsn::blob hash_key, sort_key;
         pegasus_restore_key(key, hash_key, sort_key);
 
diff --git a/src/server/pegasus_server_write.h 
b/src/server/pegasus_server_write.h
index 5ecfc84a3..e4eebfcbb 100644
--- a/src/server/pegasus_server_write.h
+++ b/src/server/pegasus_server_write.h
@@ -31,7 +31,7 @@ namespace server {
 class pegasus_server_write : public dsn::replication::replica_base
 {
 public:
-    pegasus_server_write(pegasus_server_impl *server, bool verbose_log);
+    pegasus_server_write(pegasus_server_impl *server);
 
     /// \return error code returned by rocksdb, i.e rocksdb::Status::code.
     /// **NOTE**
@@ -85,8 +85,6 @@ private:
     db_write_context _write_ctx;
     int64_t _decree;
 
-    const bool _verbose_log;
-
     typedef std::map<dsn::task_code, std::function<int(dsn::message_ex *)>> 
non_batch_writes_map;
     non_batch_writes_map _non_batch_write_handlers;
 
diff --git a/src/server/test/pegasus_server_write_test.cpp 
b/src/server/test/pegasus_server_write_test.cpp
index 02c49de69..40a40433e 100644
--- a/src/server/test/pegasus_server_write_test.cpp
+++ b/src/server/test/pegasus_server_write_test.cpp
@@ -37,7 +37,7 @@ public:
     pegasus_server_write_test() : pegasus_server_test_base()
     {
         start();
-        _server_write = dsn::make_unique<pegasus_server_write>(_server.get(), 
true);
+        _server_write = dsn::make_unique<pegasus_server_write>(_server.get());
     }
 
     void test_batch_writes()
diff --git a/src/server/test/pegasus_write_service_impl_test.cpp 
b/src/server/test/pegasus_write_service_impl_test.cpp
index ff8508d44..4175f69b3 100644
--- a/src/server/test/pegasus_write_service_impl_test.cpp
+++ b/src/server/test/pegasus_write_service_impl_test.cpp
@@ -37,7 +37,7 @@ public:
     void SetUp() override
     {
         start();
-        _server_write = dsn::make_unique<pegasus_server_write>(_server.get(), 
true);
+        _server_write = dsn::make_unique<pegasus_server_write>(_server.get());
         _write_impl = _server_write->_write_svc->_impl.get();
         _rocksdb_wrapper = _write_impl->_rocksdb_wrapper.get();
     }
diff --git a/src/server/test/pegasus_write_service_test.cpp 
b/src/server/test/pegasus_write_service_test.cpp
index 393fc4c0d..ab975b6e0 100644
--- a/src/server/test/pegasus_write_service_test.cpp
+++ b/src/server/test/pegasus_write_service_test.cpp
@@ -39,7 +39,7 @@ public:
     void SetUp() override
     {
         start();
-        _server_write = dsn::make_unique<pegasus_server_write>(_server.get(), 
true);
+        _server_write = dsn::make_unique<pegasus_server_write>(_server.get());
         _write_svc = _server_write->_write_svc.get();
     }
 
diff --git a/src/server/test/rocksdb_wrapper_test.cpp 
b/src/server/test/rocksdb_wrapper_test.cpp
index 7c21d0fa8..278cc2083 100644
--- a/src/server/test/rocksdb_wrapper_test.cpp
+++ b/src/server/test/rocksdb_wrapper_test.cpp
@@ -34,7 +34,7 @@ public:
     void SetUp() override
     {
         start();
-        _server_write = dsn::make_unique<pegasus_server_write>(_server.get(), 
true);
+        _server_write = dsn::make_unique<pegasus_server_write>(_server.get());
         _rocksdb_wrapper = 
_server_write->_write_svc->_impl->_rocksdb_wrapper.get();
 
         pegasus::pegasus_generate_key(
diff --git a/src/utils/simple_logger.cpp b/src/utils/simple_logger.cpp
index 1f7d64b77..f9e3c5157 100644
--- a/src/utils/simple_logger.cpp
+++ b/src/utils/simple_logger.cpp
@@ -40,7 +40,6 @@ namespace dsn {
 namespace tools {
 
 DSN_DEFINE_bool(tools.simple_logger, fast_flush, false, "whether to flush 
immediately");
-
 DSN_DEFINE_bool(tools.simple_logger,
                 short_header,
                 true,
@@ -85,15 +84,6 @@ static void print_header(FILE *fp, dsn_log_level_t log_level)
 
 screen_logger::screen_logger(bool short_header) { _short_header = 
short_header; }
 
-screen_logger::screen_logger(const char *log_dir)
-{
-    _short_header =
-        dsn_config_get_value_bool("tools.screen_logger",
-                                  "short_header",
-                                  true,
-                                  "whether to use short header (excluding 
file/function etc.)");
-}
-
 screen_logger::~screen_logger(void) {}
 
 void screen_logger::dsn_logv(const char *file,
diff --git a/src/utils/simple_logger.h b/src/utils/simple_logger.h
index 716d695a5..f851a0d86 100644
--- a/src/utils/simple_logger.h
+++ b/src/utils/simple_logger.h
@@ -40,8 +40,7 @@ namespace tools {
 class screen_logger : public logging_provider
 {
 public:
-    screen_logger(bool short_header);
-    screen_logger(const char *log_dir);
+    explicit screen_logger(bool short_header);
     ~screen_logger() override;
 
     virtual void dsn_logv(const char *file,
diff --git a/src/utils/test/logger.cpp b/src/utils/test/logger.cpp
index 20d0e3018..e41a969fd 100644
--- a/src/utils/test/logger.cpp
+++ b/src/utils/test/logger.cpp
@@ -94,7 +94,7 @@ TEST(tools_common, simple_logger)
     dsn::logging_provider::instance()->deregister_commands();
 
     {
-        auto logger = dsn::make_unique<screen_logger>("./");
+        auto logger = dsn::make_unique<screen_logger>(true);
         log_print(logger.get(), "%s", "test_print");
         std::thread t([](screen_logger *lg) { log_print(lg, "%s", 
"test_print"); }, logger.get());
         t.join();
diff --git a/src/zookeeper/test/config-test.ini 
b/src/zookeeper/test/config-test.ini
index 66166473e..6ac72e978 100644
--- a/src/zookeeper/test/config-test.ini
+++ b/src/zookeeper/test/config-test.ini
@@ -74,9 +74,6 @@ stderr_start_level = LOG_LEVEL_WARNING
 [tools.simulator]
 random_seed = 0
 
-[tools.screen_logger]
-short_header = false
-
 [network]
 ; how many network threads for network library (used by asio)
 io_service_worker_count = 2


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to