From 4aa68f9961b617063bc8e865b5b307bc2cd90461 Mon Sep 17 00:00:00 2001 From: levy Date: Wed, 3 Mar 2021 19:03:18 +0800 Subject: [PATCH 01/12] fix: fix heap-use-after-free in perf_counters --- src/runtime/service_api_c.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/runtime/service_api_c.cpp b/src/runtime/service_api_c.cpp index 60ffc7aaca..09a53d02c9 100644 --- a/src/runtime/service_api_c.cpp +++ b/src/runtime/service_api_c.cpp @@ -46,6 +46,8 @@ #ifdef DSN_ENABLE_GPERF #include +#include + #endif #include "service_engine.h" @@ -292,6 +294,10 @@ extern void dsn_core_init(); inline void dsn_global_init() { + // make shared_io_service destructed after perf_counters, + // because shared_io_service will destruct the timer created by perf_counters + // It will produce heap-use-after-free error if shared_io_service destructed before + dsn::tools::shared_io_service::instance(); // make perf_counters/disk_engine destructed after service_engine, // because service_engine relies on the former to monitor // task queues length and close files. From f4e75c948be3f90fabf180c8f501b6361e0ae6b5 Mon Sep 17 00:00:00 2001 From: levy Date: Wed, 3 Mar 2021 19:07:25 +0800 Subject: [PATCH 02/12] fix --- src/runtime/service_api_c.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/runtime/service_api_c.cpp b/src/runtime/service_api_c.cpp index 09a53d02c9..a7e6cfafa8 100644 --- a/src/runtime/service_api_c.cpp +++ b/src/runtime/service_api_c.cpp @@ -296,7 +296,8 @@ inline void dsn_global_init() { // make shared_io_service destructed after perf_counters, // because shared_io_service will destruct the timer created by perf_counters - // It will produce heap-use-after-free error if shared_io_service destructed before + // It will produce heap-use-after-free error if shared_io_service destructed in front of + // perf_counters dsn::tools::shared_io_service::instance(); // make perf_counters/disk_engine destructed after service_engine, // because service_engine relies on the former to monitor From f8c733bc1f349f0d3aac869b3523ce482c83f321 Mon Sep 17 00:00:00 2001 From: levy Date: Wed, 3 Mar 2021 19:07:46 +0800 Subject: [PATCH 03/12] fix --- src/runtime/service_api_c.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/service_api_c.cpp b/src/runtime/service_api_c.cpp index a7e6cfafa8..b78dce9318 100644 --- a/src/runtime/service_api_c.cpp +++ b/src/runtime/service_api_c.cpp @@ -43,10 +43,10 @@ #include #include #include +#include #ifdef DSN_ENABLE_GPERF #include -#include #endif From ec11f8897fd0f6f0c25aaa19a92d496c9c62e79b Mon Sep 17 00:00:00 2001 From: levy Date: Wed, 3 Mar 2021 19:08:03 +0800 Subject: [PATCH 04/12] fix --- src/runtime/service_api_c.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/runtime/service_api_c.cpp b/src/runtime/service_api_c.cpp index b78dce9318..05a9b5aa88 100644 --- a/src/runtime/service_api_c.cpp +++ b/src/runtime/service_api_c.cpp @@ -47,7 +47,6 @@ #ifdef DSN_ENABLE_GPERF #include - #endif #include "service_engine.h" From 95d1964a29c9eef95daf114172ff37d41585f76d Mon Sep 17 00:00:00 2001 From: levy Date: Thu, 4 Mar 2021 10:43:08 +0800 Subject: [PATCH 05/12] fix --- src/perf_counter/perf_counters.cpp | 6 ++++++ src/runtime/service_api_c.cpp | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/perf_counter/perf_counters.cpp b/src/perf_counter/perf_counters.cpp index 732cfd4b01..9e18110d4e 100644 --- a/src/perf_counter/perf_counters.cpp +++ b/src/perf_counter/perf_counters.cpp @@ -46,6 +46,12 @@ namespace dsn { perf_counters::perf_counters() { + // make shared_io_service destructed after perf_counters, + // because shared_io_service will destruct the timer created by perf_counters + // It will produce heap-use-after-free error if shared_io_service destructed in front of + // perf_counters + dsn::tools::shared_io_service::instance(); + _perf_counters_cmd = command_manager::instance().register_command( {"perf-counters"}, "perf-counters - query perf counters, filtered by OR of POSIX basic regular expressions", diff --git a/src/runtime/service_api_c.cpp b/src/runtime/service_api_c.cpp index 05a9b5aa88..60ffc7aaca 100644 --- a/src/runtime/service_api_c.cpp +++ b/src/runtime/service_api_c.cpp @@ -43,7 +43,6 @@ #include #include #include -#include #ifdef DSN_ENABLE_GPERF #include @@ -293,11 +292,6 @@ extern void dsn_core_init(); inline void dsn_global_init() { - // make shared_io_service destructed after perf_counters, - // because shared_io_service will destruct the timer created by perf_counters - // It will produce heap-use-after-free error if shared_io_service destructed in front of - // perf_counters - dsn::tools::shared_io_service::instance(); // make perf_counters/disk_engine destructed after service_engine, // because service_engine relies on the former to monitor // task queues length and close files. From 53c2ef0bf5ee8fe1537dd9bade83295894c26cfa Mon Sep 17 00:00:00 2001 From: levy Date: Thu, 4 Mar 2021 10:45:47 +0800 Subject: [PATCH 06/12] fix --- src/perf_counter/perf_counters.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/perf_counter/perf_counters.cpp b/src/perf_counter/perf_counters.cpp index 9e18110d4e..9d47b6542f 100644 --- a/src/perf_counter/perf_counters.cpp +++ b/src/perf_counter/perf_counters.cpp @@ -50,7 +50,7 @@ perf_counters::perf_counters() // because shared_io_service will destruct the timer created by perf_counters // It will produce heap-use-after-free error if shared_io_service destructed in front of // perf_counters - dsn::tools::shared_io_service::instance(); + tools::shared_io_service::instance(); _perf_counters_cmd = command_manager::instance().register_command( {"perf-counters"}, From fbfacb58f915a06932553236e757def1810917c8 Mon Sep 17 00:00:00 2001 From: levy Date: Thu, 4 Mar 2021 13:22:01 +0800 Subject: [PATCH 07/12] fix --- src/runtime/service_api_c.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/runtime/service_api_c.cpp b/src/runtime/service_api_c.cpp index 60ffc7aaca..09ebb63e4f 100644 --- a/src/runtime/service_api_c.cpp +++ b/src/runtime/service_api_c.cpp @@ -348,6 +348,18 @@ bool run(const char *config_file, bool is_server, std::string &app_list) { + // We put the loading of configuration at the beginning of this func. + // Because in dsn_global_init(), it calls perf_counters::instance(), which calls + // shared_io_service::instance(). And in the cstor of shared_io_service, it calls + // dsn_config_get_value_uint64() to load the corresponding configs. That will make + // dsn_config_get_value_uint64() get wrong value if we put dsn_config_load in behind of + // dsn_global_init() + if (!dsn_config_load(config_file, config_arguments)) { + printf("Fail to load config file %s\n", config_file); + return false; + } + dsn::flags_initialize(); + dsn_global_init(); dsn_core_init(); ::dsn::task::set_tls_dsn_context(nullptr, nullptr); @@ -358,13 +370,6 @@ bool run(const char *config_file, dsn_all.engine = &::dsn::service_engine::instance(); dsn_all.magic = 0xdeadbeef; - if (!dsn_config_load(config_file, config_arguments)) { - printf("Fail to load config file %s\n", config_file); - return false; - } - - dsn::flags_initialize(); - // pause when necessary if (dsn_config_get_value_bool("core", "pause_on_start", From 204d014de36cb4b97e162501daef70ff6f5a38c2 Mon Sep 17 00:00:00 2001 From: levy Date: Thu, 4 Mar 2021 13:41:27 +0800 Subject: [PATCH 08/12] fix --- src/runtime/service_api_c.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/service_api_c.cpp b/src/runtime/service_api_c.cpp index 09ebb63e4f..33e67ab376 100644 --- a/src/runtime/service_api_c.cpp +++ b/src/runtime/service_api_c.cpp @@ -352,7 +352,7 @@ bool run(const char *config_file, // Because in dsn_global_init(), it calls perf_counters::instance(), which calls // shared_io_service::instance(). And in the cstor of shared_io_service, it calls // dsn_config_get_value_uint64() to load the corresponding configs. That will make - // dsn_config_get_value_uint64() get wrong value if we put dsn_config_load in behind of + // dsn_config_get_value_uint64() get wrong value if we put dsn_config_load at behind of // dsn_global_init() if (!dsn_config_load(config_file, config_arguments)) { printf("Fail to load config file %s\n", config_file); From a98a55969dae1f5978941cc0319e019d25b70ef8 Mon Sep 17 00:00:00 2001 From: levy Date: Thu, 4 Mar 2021 16:21:11 +0800 Subject: [PATCH 09/12] fix: use dsn::tools::native_aio_provider as default value of FLAGS_aio_factory_name --- src/aio/disk_engine.cpp | 6 +----- src/replica/storage/simple_kv/config.ini | 2 ++ src/replica/storage/simple_kv/test/case-000.ini | 2 ++ src/replica/storage/simple_kv/test/case-001.ini | 2 ++ src/replica/storage/simple_kv/test/case-002.ini | 2 ++ src/replica/storage/simple_kv/test/case-003.ini | 2 ++ src/replica/storage/simple_kv/test/case-004.ini | 2 ++ src/replica/storage/simple_kv/test/case-005.ini | 2 ++ src/replica/storage/simple_kv/test/case-006.ini | 2 ++ src/replica/storage/simple_kv/test/case-100.ini | 2 ++ src/replica/storage/simple_kv/test/case-101.ini | 2 ++ src/replica/storage/simple_kv/test/case-102.ini | 2 ++ src/replica/storage/simple_kv/test/case-103.ini | 2 ++ src/replica/storage/simple_kv/test/case-104.ini | 2 ++ src/replica/storage/simple_kv/test/case-105.ini | 2 ++ src/replica/storage/simple_kv/test/case-106.ini | 2 ++ src/replica/storage/simple_kv/test/case-107.ini | 2 ++ src/replica/storage/simple_kv/test/case-108.ini | 2 ++ src/replica/storage/simple_kv/test/case-109.ini | 2 ++ src/replica/storage/simple_kv/test/case-200.ini | 2 ++ src/replica/storage/simple_kv/test/case-201.ini | 2 ++ src/replica/storage/simple_kv/test/case-202-0.ini | 2 ++ src/replica/storage/simple_kv/test/case-202-1.ini | 2 ++ src/replica/storage/simple_kv/test/case-203-0.ini | 2 ++ src/replica/storage/simple_kv/test/case-203-1.ini | 2 ++ src/replica/storage/simple_kv/test/case-204.ini | 2 ++ src/replica/storage/simple_kv/test/case-205.ini | 2 ++ src/replica/storage/simple_kv/test/case-206.ini | 2 ++ src/replica/storage/simple_kv/test/case-207.ini | 2 ++ src/replica/storage/simple_kv/test/case-208.ini | 2 ++ src/replica/storage/simple_kv/test/case-209.ini | 2 ++ src/replica/storage/simple_kv/test/case-210.ini | 2 ++ src/replica/storage/simple_kv/test/case-211.ini | 2 ++ src/replica/storage/simple_kv/test/case-212.ini | 2 ++ src/replica/storage/simple_kv/test/case-213.ini | 2 ++ src/replica/storage/simple_kv/test/case-214.ini | 2 ++ src/replica/storage/simple_kv/test/case-215.ini | 2 ++ src/replica/storage/simple_kv/test/case-216.ini | 2 ++ src/replica/storage/simple_kv/test/case-300-0.ini | 2 ++ src/replica/storage/simple_kv/test/case-300-1.ini | 2 ++ src/replica/storage/simple_kv/test/case-300-2.ini | 2 ++ src/replica/storage/simple_kv/test/case-301.ini | 2 ++ src/replica/storage/simple_kv/test/case-302.ini | 2 ++ src/replica/storage/simple_kv/test/case-303.ini | 2 ++ src/replica/storage/simple_kv/test/case-304.ini | 2 ++ src/replica/storage/simple_kv/test/case-305.ini | 2 ++ src/replica/storage/simple_kv/test/case-306.ini | 2 ++ src/replica/storage/simple_kv/test/case-307.ini | 2 ++ src/replica/storage/simple_kv/test/case-400.ini | 2 ++ src/replica/storage/simple_kv/test/case-401.ini | 2 ++ src/replica/storage/simple_kv/test/case-402.ini | 2 ++ src/replica/storage/simple_kv/test/case-600.ini | 2 ++ src/replica/storage/simple_kv/test/case-601.ini | 2 ++ src/replica/storage/simple_kv/test/case-602.ini | 2 ++ src/replica/storage/simple_kv/test/case-603.ini | 2 ++ src/replica/storage/simple_kv/test/config.ini | 2 ++ src/runtime/global_config.cpp | 2 +- src/runtime/nativerun.cpp | 4 ---- src/runtime/simulator.cpp | 4 ---- src/runtime/test/config-test-sim.ini | 2 ++ 60 files changed, 114 insertions(+), 14 deletions(-) diff --git a/src/aio/disk_engine.cpp b/src/aio/disk_engine.cpp index aa1f9a2e74..3b5328df1a 100644 --- a/src/aio/disk_engine.cpp +++ b/src/aio/disk_engine.cpp @@ -146,12 +146,8 @@ disk_engine::disk_engine() { aio_provider *provider = utils::factory_store::create( FLAGS_aio_factory_name, dsn::PROVIDER_TYPE_MAIN, this); - // use native_aio_provider in default if (nullptr == provider) { - derror_f("The config value of aio_factory_name is invalid, use {} in default", - native_aio_provider); - provider = utils::factory_store::create( - native_aio_provider, dsn::PROVIDER_TYPE_MAIN, this); + dassert_f(false, "The config value of aio_factory_name is invalid"); } _provider.reset(provider); } diff --git a/src/replica/storage/simple_kv/config.ini b/src/replica/storage/simple_kv/config.ini index 33ba84ced0..5dd5238ccd 100644 --- a/src/replica/storage/simple_kv/config.ini +++ b/src/replica/storage/simple_kv/config.ini @@ -39,6 +39,8 @@ toollets = tracer, profiler, fault_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + ;logging_start_level = LOG_LEVEL_WARNING ;logging_factory_name = dsn::tools::screen_logger ;logging_factory_name = dsn::tools::hpc_logger diff --git a/src/replica/storage/simple_kv/test/case-000.ini b/src/replica/storage/simple_kv/test/case-000.ini index 44e50eb56a..77d3372579 100644 --- a/src/replica/storage/simple_kv/test/case-000.ini +++ b/src/replica/storage/simple_kv/test/case-000.ini @@ -43,6 +43,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-001.ini b/src/replica/storage/simple_kv/test/case-001.ini index 3b1a93dbcd..3808491797 100644 --- a/src/replica/storage/simple_kv/test/case-001.ini +++ b/src/replica/storage/simple_kv/test/case-001.ini @@ -43,6 +43,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-002.ini b/src/replica/storage/simple_kv/test/case-002.ini index 7aba6a4789..cfc7272b1d 100644 --- a/src/replica/storage/simple_kv/test/case-002.ini +++ b/src/replica/storage/simple_kv/test/case-002.ini @@ -43,6 +43,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-003.ini b/src/replica/storage/simple_kv/test/case-003.ini index 43fea7403c..37940aee5e 100644 --- a/src/replica/storage/simple_kv/test/case-003.ini +++ b/src/replica/storage/simple_kv/test/case-003.ini @@ -43,6 +43,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-004.ini b/src/replica/storage/simple_kv/test/case-004.ini index 4ea79ea483..0f8bc7b3ef 100644 --- a/src/replica/storage/simple_kv/test/case-004.ini +++ b/src/replica/storage/simple_kv/test/case-004.ini @@ -43,6 +43,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-005.ini b/src/replica/storage/simple_kv/test/case-005.ini index 5d699b32ca..88911faa4d 100644 --- a/src/replica/storage/simple_kv/test/case-005.ini +++ b/src/replica/storage/simple_kv/test/case-005.ini @@ -43,6 +43,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-006.ini b/src/replica/storage/simple_kv/test/case-006.ini index 4f23bde4ed..0b7a02b6d5 100644 --- a/src/replica/storage/simple_kv/test/case-006.ini +++ b/src/replica/storage/simple_kv/test/case-006.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-100.ini b/src/replica/storage/simple_kv/test/case-100.ini index 8657edd7ef..86801801ce 100644 --- a/src/replica/storage/simple_kv/test/case-100.ini +++ b/src/replica/storage/simple_kv/test/case-100.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-101.ini b/src/replica/storage/simple_kv/test/case-101.ini index 8657edd7ef..86801801ce 100644 --- a/src/replica/storage/simple_kv/test/case-101.ini +++ b/src/replica/storage/simple_kv/test/case-101.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-102.ini b/src/replica/storage/simple_kv/test/case-102.ini index 1c9233fc76..eda82c9499 100644 --- a/src/replica/storage/simple_kv/test/case-102.ini +++ b/src/replica/storage/simple_kv/test/case-102.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-103.ini b/src/replica/storage/simple_kv/test/case-103.ini index edc012b61a..dbc901a4c1 100644 --- a/src/replica/storage/simple_kv/test/case-103.ini +++ b/src/replica/storage/simple_kv/test/case-103.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-104.ini b/src/replica/storage/simple_kv/test/case-104.ini index 8657edd7ef..86801801ce 100644 --- a/src/replica/storage/simple_kv/test/case-104.ini +++ b/src/replica/storage/simple_kv/test/case-104.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-105.ini b/src/replica/storage/simple_kv/test/case-105.ini index 8657edd7ef..86801801ce 100644 --- a/src/replica/storage/simple_kv/test/case-105.ini +++ b/src/replica/storage/simple_kv/test/case-105.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-106.ini b/src/replica/storage/simple_kv/test/case-106.ini index 8657edd7ef..86801801ce 100644 --- a/src/replica/storage/simple_kv/test/case-106.ini +++ b/src/replica/storage/simple_kv/test/case-106.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-107.ini b/src/replica/storage/simple_kv/test/case-107.ini index 8657edd7ef..86801801ce 100644 --- a/src/replica/storage/simple_kv/test/case-107.ini +++ b/src/replica/storage/simple_kv/test/case-107.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-108.ini b/src/replica/storage/simple_kv/test/case-108.ini index 8657edd7ef..86801801ce 100644 --- a/src/replica/storage/simple_kv/test/case-108.ini +++ b/src/replica/storage/simple_kv/test/case-108.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-109.ini b/src/replica/storage/simple_kv/test/case-109.ini index 71e09be95f..dc546151a1 100644 --- a/src/replica/storage/simple_kv/test/case-109.ini +++ b/src/replica/storage/simple_kv/test/case-109.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-200.ini b/src/replica/storage/simple_kv/test/case-200.ini index 8657edd7ef..86801801ce 100644 --- a/src/replica/storage/simple_kv/test/case-200.ini +++ b/src/replica/storage/simple_kv/test/case-200.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-201.ini b/src/replica/storage/simple_kv/test/case-201.ini index 8657edd7ef..86801801ce 100644 --- a/src/replica/storage/simple_kv/test/case-201.ini +++ b/src/replica/storage/simple_kv/test/case-201.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-202-0.ini b/src/replica/storage/simple_kv/test/case-202-0.ini index 04f7155bbc..ad2fd591f9 100644 --- a/src/replica/storage/simple_kv/test/case-202-0.ini +++ b/src/replica/storage/simple_kv/test/case-202-0.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-202-1.ini b/src/replica/storage/simple_kv/test/case-202-1.ini index 04f7155bbc..ad2fd591f9 100644 --- a/src/replica/storage/simple_kv/test/case-202-1.ini +++ b/src/replica/storage/simple_kv/test/case-202-1.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-203-0.ini b/src/replica/storage/simple_kv/test/case-203-0.ini index 97ef5e10c8..ad98c62e48 100644 --- a/src/replica/storage/simple_kv/test/case-203-0.ini +++ b/src/replica/storage/simple_kv/test/case-203-0.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-203-1.ini b/src/replica/storage/simple_kv/test/case-203-1.ini index 97ef5e10c8..ad98c62e48 100644 --- a/src/replica/storage/simple_kv/test/case-203-1.ini +++ b/src/replica/storage/simple_kv/test/case-203-1.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-204.ini b/src/replica/storage/simple_kv/test/case-204.ini index a33fa57279..29103bfaef 100644 --- a/src/replica/storage/simple_kv/test/case-204.ini +++ b/src/replica/storage/simple_kv/test/case-204.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-205.ini b/src/replica/storage/simple_kv/test/case-205.ini index a33fa57279..29103bfaef 100644 --- a/src/replica/storage/simple_kv/test/case-205.ini +++ b/src/replica/storage/simple_kv/test/case-205.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-206.ini b/src/replica/storage/simple_kv/test/case-206.ini index a33fa57279..29103bfaef 100644 --- a/src/replica/storage/simple_kv/test/case-206.ini +++ b/src/replica/storage/simple_kv/test/case-206.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-207.ini b/src/replica/storage/simple_kv/test/case-207.ini index a33fa57279..29103bfaef 100644 --- a/src/replica/storage/simple_kv/test/case-207.ini +++ b/src/replica/storage/simple_kv/test/case-207.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-208.ini b/src/replica/storage/simple_kv/test/case-208.ini index a33fa57279..29103bfaef 100644 --- a/src/replica/storage/simple_kv/test/case-208.ini +++ b/src/replica/storage/simple_kv/test/case-208.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-209.ini b/src/replica/storage/simple_kv/test/case-209.ini index a33fa57279..29103bfaef 100644 --- a/src/replica/storage/simple_kv/test/case-209.ini +++ b/src/replica/storage/simple_kv/test/case-209.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-210.ini b/src/replica/storage/simple_kv/test/case-210.ini index c757146252..a6811bbbea 100644 --- a/src/replica/storage/simple_kv/test/case-210.ini +++ b/src/replica/storage/simple_kv/test/case-210.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-211.ini b/src/replica/storage/simple_kv/test/case-211.ini index c757146252..a6811bbbea 100644 --- a/src/replica/storage/simple_kv/test/case-211.ini +++ b/src/replica/storage/simple_kv/test/case-211.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-212.ini b/src/replica/storage/simple_kv/test/case-212.ini index c757146252..a6811bbbea 100644 --- a/src/replica/storage/simple_kv/test/case-212.ini +++ b/src/replica/storage/simple_kv/test/case-212.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-213.ini b/src/replica/storage/simple_kv/test/case-213.ini index d6b90e39e4..e020634a48 100644 --- a/src/replica/storage/simple_kv/test/case-213.ini +++ b/src/replica/storage/simple_kv/test/case-213.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-214.ini b/src/replica/storage/simple_kv/test/case-214.ini index a33fa57279..29103bfaef 100644 --- a/src/replica/storage/simple_kv/test/case-214.ini +++ b/src/replica/storage/simple_kv/test/case-214.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-215.ini b/src/replica/storage/simple_kv/test/case-215.ini index a33fa57279..29103bfaef 100644 --- a/src/replica/storage/simple_kv/test/case-215.ini +++ b/src/replica/storage/simple_kv/test/case-215.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-216.ini b/src/replica/storage/simple_kv/test/case-216.ini index a33fa57279..29103bfaef 100644 --- a/src/replica/storage/simple_kv/test/case-216.ini +++ b/src/replica/storage/simple_kv/test/case-216.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-300-0.ini b/src/replica/storage/simple_kv/test/case-300-0.ini index 8657edd7ef..86801801ce 100644 --- a/src/replica/storage/simple_kv/test/case-300-0.ini +++ b/src/replica/storage/simple_kv/test/case-300-0.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-300-1.ini b/src/replica/storage/simple_kv/test/case-300-1.ini index 8657edd7ef..86801801ce 100644 --- a/src/replica/storage/simple_kv/test/case-300-1.ini +++ b/src/replica/storage/simple_kv/test/case-300-1.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-300-2.ini b/src/replica/storage/simple_kv/test/case-300-2.ini index 8657edd7ef..86801801ce 100644 --- a/src/replica/storage/simple_kv/test/case-300-2.ini +++ b/src/replica/storage/simple_kv/test/case-300-2.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-301.ini b/src/replica/storage/simple_kv/test/case-301.ini index 8657edd7ef..86801801ce 100644 --- a/src/replica/storage/simple_kv/test/case-301.ini +++ b/src/replica/storage/simple_kv/test/case-301.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-302.ini b/src/replica/storage/simple_kv/test/case-302.ini index 49a5d898b0..824183231a 100644 --- a/src/replica/storage/simple_kv/test/case-302.ini +++ b/src/replica/storage/simple_kv/test/case-302.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-303.ini b/src/replica/storage/simple_kv/test/case-303.ini index 1f34fcd9e2..3d77776032 100644 --- a/src/replica/storage/simple_kv/test/case-303.ini +++ b/src/replica/storage/simple_kv/test/case-303.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-304.ini b/src/replica/storage/simple_kv/test/case-304.ini index 8657edd7ef..86801801ce 100644 --- a/src/replica/storage/simple_kv/test/case-304.ini +++ b/src/replica/storage/simple_kv/test/case-304.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-305.ini b/src/replica/storage/simple_kv/test/case-305.ini index 1f34fcd9e2..3d77776032 100644 --- a/src/replica/storage/simple_kv/test/case-305.ini +++ b/src/replica/storage/simple_kv/test/case-305.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-306.ini b/src/replica/storage/simple_kv/test/case-306.ini index 8657edd7ef..86801801ce 100644 --- a/src/replica/storage/simple_kv/test/case-306.ini +++ b/src/replica/storage/simple_kv/test/case-306.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-307.ini b/src/replica/storage/simple_kv/test/case-307.ini index 8657edd7ef..86801801ce 100644 --- a/src/replica/storage/simple_kv/test/case-307.ini +++ b/src/replica/storage/simple_kv/test/case-307.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-400.ini b/src/replica/storage/simple_kv/test/case-400.ini index 8657edd7ef..86801801ce 100644 --- a/src/replica/storage/simple_kv/test/case-400.ini +++ b/src/replica/storage/simple_kv/test/case-400.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-401.ini b/src/replica/storage/simple_kv/test/case-401.ini index 8657edd7ef..86801801ce 100644 --- a/src/replica/storage/simple_kv/test/case-401.ini +++ b/src/replica/storage/simple_kv/test/case-401.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-402.ini b/src/replica/storage/simple_kv/test/case-402.ini index 8657edd7ef..86801801ce 100644 --- a/src/replica/storage/simple_kv/test/case-402.ini +++ b/src/replica/storage/simple_kv/test/case-402.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-600.ini b/src/replica/storage/simple_kv/test/case-600.ini index 4f23bde4ed..0b7a02b6d5 100644 --- a/src/replica/storage/simple_kv/test/case-600.ini +++ b/src/replica/storage/simple_kv/test/case-600.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-601.ini b/src/replica/storage/simple_kv/test/case-601.ini index 548c257061..89b2549a5c 100644 --- a/src/replica/storage/simple_kv/test/case-601.ini +++ b/src/replica/storage/simple_kv/test/case-601.ini @@ -44,6 +44,8 @@ toollets = tracer,test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-602.ini b/src/replica/storage/simple_kv/test/case-602.ini index 4f23bde4ed..0b7a02b6d5 100644 --- a/src/replica/storage/simple_kv/test/case-602.ini +++ b/src/replica/storage/simple_kv/test/case-602.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/case-603.ini b/src/replica/storage/simple_kv/test/case-603.ini index 29e23ec134..68098bd263 100644 --- a/src/replica/storage/simple_kv/test/case-603.ini +++ b/src/replica/storage/simple_kv/test/case-603.ini @@ -44,6 +44,8 @@ toollets = test_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger diff --git a/src/replica/storage/simple_kv/test/config.ini b/src/replica/storage/simple_kv/test/config.ini index a5bf5abd94..a8fd253299 100644 --- a/src/replica/storage/simple_kv/test/config.ini +++ b/src/replica/storage/simple_kv/test/config.ini @@ -61,6 +61,8 @@ toollets = tracer, profiler, fault_injector ;toollets = profiler, fault_injector pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + ;logging_start_level = LOG_LEVEL_WARNING ;logging_factory_name = dsn::tools::screen_logger ;logging_factory_name = dsn::tools::hpc_logger diff --git a/src/runtime/global_config.cpp b/src/runtime/global_config.cpp index 745d216397..5b2cff1d2a 100644 --- a/src/runtime/global_config.cpp +++ b/src/runtime/global_config.cpp @@ -47,7 +47,7 @@ namespace dsn { -DSN_DEFINE_string("core", aio_factory_name, "", "asynchonous file system provider"); +DSN_DEFINE_string("core", aio_factory_name, "dsn::tools::native_aio_provider", "asynchonous file system provider"); static bool build_client_network_confs(const char *section, /*out*/ network_client_configs &nss, diff --git a/src/runtime/nativerun.cpp b/src/runtime/nativerun.cpp index d6c3bb29da..0f87e072fb 100644 --- a/src/runtime/nativerun.cpp +++ b/src/runtime/nativerun.cpp @@ -40,10 +40,6 @@ namespace tools { void nativerun::install(service_spec &spec) { - if (0 == strlen(FLAGS_aio_factory_name)) { - FLAGS_aio_factory_name = "dsn::tools::native_aio_provider"; - } - if (spec.env_factory_name == "") spec.env_factory_name = ("dsn::env_provider"); diff --git a/src/runtime/simulator.cpp b/src/runtime/simulator.cpp index b78c8c27c1..dc2cfed793 100644 --- a/src/runtime/simulator.cpp +++ b/src/runtime/simulator.cpp @@ -64,10 +64,6 @@ void simulator::install(service_spec &spec) scheduler::instance(); - if (0 == strlen(FLAGS_aio_factory_name)) { - FLAGS_aio_factory_name = "dsn::tools::sim_aio_provider"; - } - if (spec.env_factory_name == "") spec.env_factory_name = ("dsn::tools::sim_env_provider"); diff --git a/src/runtime/test/config-test-sim.ini b/src/runtime/test/config-test-sim.ini index 88f7b9f7f7..5aeef41d77 100644 --- a/src/runtime/test/config-test-sim.ini +++ b/src/runtime/test/config-test-sim.ini @@ -37,6 +37,8 @@ tool = simulator toollets = tracer, profiler pause_on_start = false +aio_factory_name = dsn::tools::sim_aio_provider + logging_start_level = LOG_LEVEL_INFORMATION logging_factory_name = dsn::tools::simple_logger From 7861be5c2f8b2266bc1d9a5f451df81917bee230 Mon Sep 17 00:00:00 2001 From: levy Date: Thu, 4 Mar 2021 16:38:34 +0800 Subject: [PATCH 10/12] fix --- include/dsn/tool-api/global_config.h | 2 -- src/aio/disk_engine.cpp | 3 +++ src/runtime/global_config.cpp | 2 -- src/runtime/nativerun.cpp | 4 ++-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/dsn/tool-api/global_config.h b/include/dsn/tool-api/global_config.h index 30b1c4e164..51ac41405b 100644 --- a/include/dsn/tool-api/global_config.h +++ b/include/dsn/tool-api/global_config.h @@ -198,6 +198,4 @@ CONFIG_FLD_STRING(rwlock_nr_factory_name, "", "non-recurisve rwlock provider") CONFIG_FLD_STRING(semaphore_factory_name, "", "semaphore provider") CONFIG_FLD_STRING(logging_factory_name, "", "logging provider") CONFIG_END - -extern const char *FLAGS_aio_factory_name; } // namespace dsn diff --git a/src/aio/disk_engine.cpp b/src/aio/disk_engine.cpp index 3b5328df1a..d4cb13ddf2 100644 --- a/src/aio/disk_engine.cpp +++ b/src/aio/disk_engine.cpp @@ -26,6 +26,7 @@ #include #include +#include #include "disk_engine.h" #include "sim_aio_provider.h" @@ -36,6 +37,8 @@ using namespace dsn::utils; namespace dsn { using namespace aio; +DSN_DEFINE_string("core", aio_factory_name, "", "asynchonous file system provider"); + DEFINE_TASK_CODE_AIO(LPC_AIO_BATCH_WRITE, TASK_PRIORITY_COMMON, THREAD_POOL_DEFAULT) const char *native_aio_provider = "dsn::tools::native_aio_provider"; diff --git a/src/runtime/global_config.cpp b/src/runtime/global_config.cpp index 5b2cff1d2a..1749f40f0a 100644 --- a/src/runtime/global_config.cpp +++ b/src/runtime/global_config.cpp @@ -47,8 +47,6 @@ namespace dsn { -DSN_DEFINE_string("core", aio_factory_name, "dsn::tools::native_aio_provider", "asynchonous file system provider"); - static bool build_client_network_confs(const char *section, /*out*/ network_client_configs &nss, network_client_configs *default_spec) diff --git a/src/runtime/nativerun.cpp b/src/runtime/nativerun.cpp index 0f87e072fb..b7ce3ad8a4 100644 --- a/src/runtime/nativerun.cpp +++ b/src/runtime/nativerun.cpp @@ -101,5 +101,5 @@ void nativerun::install(service_spec &spec) } void nativerun::run() { tool_app::run(); } -} -} // end namespace dsn::tools +} // namespace tools +} // namespace dsn From 7c560a691818559883e4e8914264969c18a3ebf4 Mon Sep 17 00:00:00 2001 From: levy Date: Thu, 4 Mar 2021 16:48:14 +0800 Subject: [PATCH 11/12] fix --- src/aio/disk_engine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/aio/disk_engine.cpp b/src/aio/disk_engine.cpp index d4cb13ddf2..d74e4278ff 100644 --- a/src/aio/disk_engine.cpp +++ b/src/aio/disk_engine.cpp @@ -37,14 +37,14 @@ using namespace dsn::utils; namespace dsn { using namespace aio; -DSN_DEFINE_string("core", aio_factory_name, "", "asynchonous file system provider"); - DEFINE_TASK_CODE_AIO(LPC_AIO_BATCH_WRITE, TASK_PRIORITY_COMMON, THREAD_POOL_DEFAULT) const char *native_aio_provider = "dsn::tools::native_aio_provider"; DSN_REGISTER_COMPONENT_PROVIDER(native_linux_aio_provider, native_aio_provider); DSN_REGISTER_COMPONENT_PROVIDER(sim_aio_provider, "dsn::tools::sim_aio_provider"); +DSN_DEFINE_string("core", aio_factory_name, native_aio_provider, "asynchonous file system provider"); + //----------------- disk_file ------------------------ aio_task *disk_write_queue::unlink_next_workload(void *plength) { From 3ccc91a4cceb3b5593a62b4e35b5ed95f85da3ef Mon Sep 17 00:00:00 2001 From: levy Date: Thu, 4 Mar 2021 16:50:40 +0800 Subject: [PATCH 12/12] fix --- src/aio/disk_engine.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/aio/disk_engine.cpp b/src/aio/disk_engine.cpp index d74e4278ff..0c3cfe7c44 100644 --- a/src/aio/disk_engine.cpp +++ b/src/aio/disk_engine.cpp @@ -43,7 +43,10 @@ const char *native_aio_provider = "dsn::tools::native_aio_provider"; DSN_REGISTER_COMPONENT_PROVIDER(native_linux_aio_provider, native_aio_provider); DSN_REGISTER_COMPONENT_PROVIDER(sim_aio_provider, "dsn::tools::sim_aio_provider"); -DSN_DEFINE_string("core", aio_factory_name, native_aio_provider, "asynchonous file system provider"); +DSN_DEFINE_string("core", + aio_factory_name, + native_aio_provider, + "asynchonous file system provider"); //----------------- disk_file ------------------------ aio_task *disk_write_queue::unlink_next_workload(void *plength)