From 45b331e58e405052c3586f73806590b9ff9b4089 Mon Sep 17 00:00:00 2001 From: levy Date: Wed, 8 Jul 2020 15:36:13 +0800 Subject: [PATCH 01/12] failure-detector --- src/CMakeLists.txt | 1 + src/dist/CMakeLists.txt | 2 - .../CMakeLists.txt | 17 --- src/dist/replication/lib/CMakeLists.txt | 1 - .../replication/test/simple_kv/CMakeLists.txt | 1 - .../failure_detector/CMakeLists.txt | 4 +- .../failure_detector/failure_detector.cpp | 0 .../failure_detector_multimaster.cpp | 0 src/{dist => }/failure_detector/fd.thrift | 0 src/{dist => }/failure_detector/fd_types.cpp | 0 src/failure_detector/tests/CMakeLists.txt | 30 +++++ src/failure_detector/tests/clear.sh | 3 + src/failure_detector/tests/config-test.ini | 119 ++++++++++++++++++ .../tests}/config-whitelist-test-failed.ini | 0 .../tests}/config-whitelist-test.ini | 0 .../tests}/failure_detector.cpp | 0 src/failure_detector/tests/gtest.filter | 4 + src/failure_detector/tests/main.cpp | 94 ++++++++++++++ src/failure_detector/tests/run.sh | 30 +++++ src/tests/dsn/CMakeLists.txt | 4 - src/tests/dsn/main.cpp | 2 - 21 files changed, 284 insertions(+), 28 deletions(-) delete mode 100644 src/dist/failure_detector_multimaster/CMakeLists.txt rename src/{dist => }/failure_detector/CMakeLists.txt (90%) rename src/{dist => }/failure_detector/failure_detector.cpp (100%) rename src/{dist/failure_detector_multimaster => failure_detector}/failure_detector_multimaster.cpp (100%) rename src/{dist => }/failure_detector/fd.thrift (100%) rename src/{dist => }/failure_detector/fd_types.cpp (100%) create mode 100644 src/failure_detector/tests/CMakeLists.txt create mode 100755 src/failure_detector/tests/clear.sh create mode 100644 src/failure_detector/tests/config-test.ini rename src/{tests/dsn => failure_detector/tests}/config-whitelist-test-failed.ini (100%) rename src/{tests/dsn => failure_detector/tests}/config-whitelist-test.ini (100%) rename src/{tests/dsn => failure_detector/tests}/failure_detector.cpp (100%) create mode 100644 src/failure_detector/tests/gtest.filter create mode 100644 src/failure_detector/tests/main.cpp create mode 100755 src/failure_detector/tests/run.sh diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2db60e1920..83ac6b215b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,4 +3,5 @@ if(UNIX) endif() add_subdirectory(core) add_subdirectory(dist) +add_subdirectory(failure_detector) add_subdirectory(tests) diff --git a/src/dist/CMakeLists.txt b/src/dist/CMakeLists.txt index 4426a9fef4..4746aa99d3 100644 --- a/src/dist/CMakeLists.txt +++ b/src/dist/CMakeLists.txt @@ -1,6 +1,4 @@ -add_subdirectory(failure_detector) add_subdirectory(replication) -add_subdirectory(failure_detector_multimaster) add_subdirectory(block_service) add_subdirectory(nfs) add_subdirectory(cmd) diff --git a/src/dist/failure_detector_multimaster/CMakeLists.txt b/src/dist/failure_detector_multimaster/CMakeLists.txt deleted file mode 100644 index 33cc36f7f2..0000000000 --- a/src/dist/failure_detector_multimaster/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -set(MY_PROJ_NAME dsn.failure_detector.multimaster) - -# Source files under CURRENT project directory will be automatically included. -# You can manually set MY_PROJ_SRC to include source files under other directories. -set(MY_PROJ_SRC "") - -# Search mode for source files under CURRENT project directory? -# "GLOB_RECURSE" for recursive search -# "GLOB" for non-recursive search -set(MY_SRC_SEARCH_MODE "GLOB") - -set(MY_PROJ_LIBS "") - -# Extra files that will be installed -set(MY_BINPLACES "") - -dsn_add_static_library() \ No newline at end of file diff --git a/src/dist/replication/lib/CMakeLists.txt b/src/dist/replication/lib/CMakeLists.txt index c55bc42a22..e8d4faa0d2 100644 --- a/src/dist/replication/lib/CMakeLists.txt +++ b/src/dist/replication/lib/CMakeLists.txt @@ -32,7 +32,6 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS dsn_replication_common dsn.failure_detector - dsn.failure_detector.multimaster dsn.block_service dsn_nfs dsn_dist_cmd diff --git a/src/dist/replication/test/simple_kv/CMakeLists.txt b/src/dist/replication/test/simple_kv/CMakeLists.txt index cbe04e80f1..a73f2e2fc4 100644 --- a/src/dist/replication/test/simple_kv/CMakeLists.txt +++ b/src/dist/replication/test/simple_kv/CMakeLists.txt @@ -10,7 +10,6 @@ set(MY_PROJ_LIBS dsn_replica_server dsn_meta_server dsn_replication_common dsn_replication_client - dsn.failure_detector.multimaster dsn.failure_detector dsn.replication.zookeeper_provider dsn_runtime diff --git a/src/dist/failure_detector/CMakeLists.txt b/src/failure_detector/CMakeLists.txt similarity index 90% rename from src/dist/failure_detector/CMakeLists.txt rename to src/failure_detector/CMakeLists.txt index b94279e190..004f15f078 100644 --- a/src/dist/failure_detector/CMakeLists.txt +++ b/src/failure_detector/CMakeLists.txt @@ -14,4 +14,6 @@ set(MY_PROJ_LIBS "") # Extra files that will be installed set(MY_BINPLACES "") -dsn_add_static_library() \ No newline at end of file +dsn_add_static_library() + +add_subdirectory(tests) diff --git a/src/dist/failure_detector/failure_detector.cpp b/src/failure_detector/failure_detector.cpp similarity index 100% rename from src/dist/failure_detector/failure_detector.cpp rename to src/failure_detector/failure_detector.cpp diff --git a/src/dist/failure_detector_multimaster/failure_detector_multimaster.cpp b/src/failure_detector/failure_detector_multimaster.cpp similarity index 100% rename from src/dist/failure_detector_multimaster/failure_detector_multimaster.cpp rename to src/failure_detector/failure_detector_multimaster.cpp diff --git a/src/dist/failure_detector/fd.thrift b/src/failure_detector/fd.thrift similarity index 100% rename from src/dist/failure_detector/fd.thrift rename to src/failure_detector/fd.thrift diff --git a/src/dist/failure_detector/fd_types.cpp b/src/failure_detector/fd_types.cpp similarity index 100% rename from src/dist/failure_detector/fd_types.cpp rename to src/failure_detector/fd_types.cpp diff --git a/src/failure_detector/tests/CMakeLists.txt b/src/failure_detector/tests/CMakeLists.txt new file mode 100644 index 0000000000..534bce6718 --- /dev/null +++ b/src/failure_detector/tests/CMakeLists.txt @@ -0,0 +1,30 @@ +set(MY_PROJ_NAME dsn.failure_detector.tests) + +# Source files under CURRENT project directory will be automatically included. +# You can manually set MY_PROJ_SRC to include source files under other directories. +set(MY_PROJ_SRC "") + +# Search mode for source files under CURRENT project directory? +# "GLOB_RECURSE" for recursive search +# "GLOB" for non-recursive search +set(MY_SRC_SEARCH_MODE "GLOB") + +set(MY_PROJ_LIBS + dsn.failure_detector + dsn_runtime + gtest + ) + +set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) + +# Extra files that will be installed +set(MY_BINPLACES + "${CMAKE_CURRENT_SOURCE_DIR}/run.sh" + "${CMAKE_CURRENT_SOURCE_DIR}/clear.sh" + "${CMAKE_CURRENT_SOURCE_DIR}/config-test.ini" + "${CMAKE_CURRENT_SOURCE_DIR}/config-whitelist-test.ini" + "${CMAKE_CURRENT_SOURCE_DIR}/config-whitelist-test-failed.ini" + "${CMAKE_CURRENT_SOURCE_DIR}/gtest.filter" +) + +dsn_add_test() diff --git a/src/failure_detector/tests/clear.sh b/src/failure_detector/tests/clear.sh new file mode 100755 index 0000000000..128ad1d18c --- /dev/null +++ b/src/failure_detector/tests/clear.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +rm -rf log.* *.log data diff --git a/src/failure_detector/tests/config-test.ini b/src/failure_detector/tests/config-test.ini new file mode 100644 index 0000000000..e0bbb6d013 --- /dev/null +++ b/src/failure_detector/tests/config-test.ini @@ -0,0 +1,119 @@ +[apps..default] +run = true +count = 1 +;network.client.RPC_CHANNEL_TCP = dsn::tools::sim_network_provider, 65536 +;network.client.RPC_CHANNEL_UDP = dsn::tools::sim_network_provider, 65536 +;network.server.0.RPC_CHANNEL_TCP = dsn::tools::sim_network_provider, 65536 + +[apps.client] +type = test +arguments = localhost 20101 +run = true +ports = +count = 1 +delay_seconds = 1 +pools = THREAD_POOL_DEFAULT, THREAD_POOL_DLOCK, THREAD_POOL_REPLICATION, THREAD_POOL_REPLICATION_LONG, THREAD_POOL_FDS_SERVICE + +[apps.server] +type = test +arguments = +ports = 20101 +run = false +count = 0 +pools = THREAD_POOL_DEFAULT, THREAD_POOL_REPLICATION + +[apps.add_server] +type = adder +arguments = +ports = 20201 +run = true +count = 3 +pools = THREAD_POOL_DEFAULT, THREAD_POOL_DLOCK + +[apps.test_worker] +type = worker +arguments = +ports = 40001 +run = true +count = 1 +pools = THREAD_POOL_DEFAULT, THREAD_POOL_FD + +[apps.test_master] +type = master +arguments = +ports = 30001 +run = true +count = 3 +pools = THREAD_POOL_DEFAULT, THREAD_POOL_FD + +[core] +;tool = simulator +tool = nativerun + +;toollets = tracer, profiler +;fault_injector +pause_on_start = false + +logging_start_level = LOG_LEVEL_INFORMATION +logging_factory_name = dsn::tools::simple_logger + + +[tools.simple_logger] +fast_flush = true +short_header = false +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 + +[task..default] +is_trace = true +is_profile = true +allow_inline = false +rpc_call_channel = RPC_CHANNEL_TCP +rpc_message_header_format = dsn +rpc_timeout_milliseconds = 5000 + +[task.LPC_AIO_IMMEDIATE_CALLBACK] +is_trace = false +is_profile = false +allow_inline = false + +[task.LPC_RPC_TIMEOUT] +is_trace = false +is_profile = false + +; specification for each thread pool +[threadpool..default] +worker_count = 2 + +[threadpool.THREAD_POOL_DEFAULT] +partitioned = false +worker_priority = THREAD_xPRIORITY_NORMAL + +[threadpool.THREAD_POOL_TEST_SERVER] +partitioned = false + +[threadpool.THREAD_POOL_FDS_SERVICE] +worker_count = 8 + +[threadpool.THREAD_POOL_DLOCK] +partitioned = true + +[zookeeper] +hosts_list = localhost:12181 +timeout_ms = 30000 +logfile = zoolog.log + +[fds_concurrent_test] +total_files = 64 +min_size = 100 +max_size = 150 + diff --git a/src/tests/dsn/config-whitelist-test-failed.ini b/src/failure_detector/tests/config-whitelist-test-failed.ini similarity index 100% rename from src/tests/dsn/config-whitelist-test-failed.ini rename to src/failure_detector/tests/config-whitelist-test-failed.ini diff --git a/src/tests/dsn/config-whitelist-test.ini b/src/failure_detector/tests/config-whitelist-test.ini similarity index 100% rename from src/tests/dsn/config-whitelist-test.ini rename to src/failure_detector/tests/config-whitelist-test.ini diff --git a/src/tests/dsn/failure_detector.cpp b/src/failure_detector/tests/failure_detector.cpp similarity index 100% rename from src/tests/dsn/failure_detector.cpp rename to src/failure_detector/tests/failure_detector.cpp diff --git a/src/failure_detector/tests/gtest.filter b/src/failure_detector/tests/gtest.filter new file mode 100644 index 0000000000..1c81d6d94d --- /dev/null +++ b/src/failure_detector/tests/gtest.filter @@ -0,0 +1,4 @@ +config-test.ini distributed_lock_service_zookeeper.simple_lock_unlock +config-test.ini -distributed_lock_service_zookeeper.simple_lock_unlock:fd.not_in_whitelist +config-whitelist-test.ini -distributed_lock_service_zookeeper.simple_lock_unlock:fd.not_in_whitelist +config-whitelist-test-failed.ini fd.not_in_whitelist diff --git a/src/failure_detector/tests/main.cpp b/src/failure_detector/tests/main.cpp new file mode 100644 index 0000000000..b400159153 --- /dev/null +++ b/src/failure_detector/tests/main.cpp @@ -0,0 +1,94 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2015 Microsoft Corporation + * + * -=- Robust Distributed System Nucleus (rDSN) -=- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/* + * Description: + * What is this file about? + * + * Revision history: + * xxxx-xx-xx, author, first version + * xxxx-xx-xx, author, fix bug about xxx + */ + +#include + +#ifndef _WIN32 +#include +#include +#endif + +#include +#include + +int g_test_count = 0; +int g_test_ret = 0; + +extern void lock_test_init(); + +class test_client : public ::dsn::service_app +{ +public: + test_client(const dsn::service_app_info *info) : ::dsn::service_app(info) {} + + ::dsn::error_code start(const std::vector &args) + { + int argc = args.size(); + char *argv[20]; + for (int i = 0; i < argc; ++i) { + argv[i] = (char *)(args[i].c_str()); + } + testing::InitGoogleTest(&argc, argv); + g_test_ret = RUN_ALL_TESTS(); + g_test_count = 1; + return ::dsn::ERR_OK; + } + + ::dsn::error_code stop(bool cleanup = false) { return ::dsn::ERR_OK; } +}; + +GTEST_API_ int main(int argc, char **argv) +{ + testing::InitGoogleTest(&argc, argv); + + // register all possible services + dsn::service_app::register_factory("test"); + fd_test_init(); + + // specify what services and tools will run in config file, then run + if (argc < 2) + dsn_run_config("config-test.ini", false); + else + dsn_run_config(argv[1], false); + + while (g_test_count == 0) { + std::this_thread::sleep_for(std::chrono::seconds(1)); + } + +#ifndef ENABLE_GCOV + dsn_exit(g_test_ret); +#endif + return g_test_ret; +} diff --git a/src/failure_detector/tests/run.sh b/src/failure_detector/tests/run.sh new file mode 100755 index 0000000000..7efc3d9eb8 --- /dev/null +++ b/src/failure_detector/tests/run.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +if [ -z "${REPORT_DIR}" ]; then + REPORT_DIR="." +fi + +while read -r -a line; do + test_case=${line[0]} + gtest_filter=${line[1]} + output_xml="${REPORT_DIR}/dsn.failure_detector.tests_${test_case/.ini/.xml}" + echo "============ run dsn.failure_detector.tests ${test_case} with gtest_filter ${gtest_filter} ============" + ./clear.sh + GTEST_OUTPUT="xml:${output_xml}" GTEST_FILTER=${gtest_filter} ./dsn.failure_detector.tests ${test_case} + + if [ $? -ne 0 ]; then + echo "run dsn.failure_detector.tests $test_case failed" + echo "---- ls ----" + ls -l + if find . -name log.1.txt; then + echo "---- tail -n 100 log.1.txt ----" + tail -n 100 `find . -name log.1.txt` + fi + if [ -f core ]; then + echo "---- gdb ./dsn.failure_detector.tests core ----" + gdb ./dsn.failure_detector.tests core -ex "thread apply all bt" -ex "set pagination 0" -batch + fi + exit 1 + fi + echo "============ done dsn.failure_detector.tests ${test_case} with gtest_filter ${gtest_filter} ============" +done ("test"); lock_test_init(); - fd_test_init(); // specify what services and tools will run in config file, then run if (argc < 2) From ce1b374408afec15333cd2c1d6482c5d78757a21 Mon Sep 17 00:00:00 2001 From: levy Date: Wed, 8 Jul 2020 17:04:57 +0800 Subject: [PATCH 02/12] fix --- src/failure_detector/tests/CMakeLists.txt | 7 +++++-- src/failure_detector/tests/gtest.filter | 5 ++--- src/failure_detector/tests/main.cpp | 2 +- src/tests/dsn/gtest.filter | 4 +--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/failure_detector/tests/CMakeLists.txt b/src/failure_detector/tests/CMakeLists.txt index 534bce6718..d739a5cd27 100644 --- a/src/failure_detector/tests/CMakeLists.txt +++ b/src/failure_detector/tests/CMakeLists.txt @@ -9,9 +9,12 @@ set(MY_PROJ_SRC "") # "GLOB" for non-recursive search set(MY_SRC_SEARCH_MODE "GLOB") -set(MY_PROJ_LIBS - dsn.failure_detector +set(MY_PROJ_LIBS dsn_runtime + dsn_meta_server + dsn_replica_server + dsn_replication_common + dsn.failure_detector gtest ) diff --git a/src/failure_detector/tests/gtest.filter b/src/failure_detector/tests/gtest.filter index 1c81d6d94d..ae27bf5660 100644 --- a/src/failure_detector/tests/gtest.filter +++ b/src/failure_detector/tests/gtest.filter @@ -1,4 +1,3 @@ -config-test.ini distributed_lock_service_zookeeper.simple_lock_unlock -config-test.ini -distributed_lock_service_zookeeper.simple_lock_unlock:fd.not_in_whitelist -config-whitelist-test.ini -distributed_lock_service_zookeeper.simple_lock_unlock:fd.not_in_whitelist +config-test.ini -fd.not_in_whitelist +config-whitelist-test.ini -fd.not_in_whitelist config-whitelist-test-failed.ini fd.not_in_whitelist diff --git a/src/failure_detector/tests/main.cpp b/src/failure_detector/tests/main.cpp index b400159153..89801ce0bf 100644 --- a/src/failure_detector/tests/main.cpp +++ b/src/failure_detector/tests/main.cpp @@ -46,7 +46,7 @@ int g_test_count = 0; int g_test_ret = 0; -extern void lock_test_init(); +extern void fd_test_init(); class test_client : public ::dsn::service_app { diff --git a/src/tests/dsn/gtest.filter b/src/tests/dsn/gtest.filter index 1c81d6d94d..9d145cdc7c 100644 --- a/src/tests/dsn/gtest.filter +++ b/src/tests/dsn/gtest.filter @@ -1,4 +1,2 @@ config-test.ini distributed_lock_service_zookeeper.simple_lock_unlock -config-test.ini -distributed_lock_service_zookeeper.simple_lock_unlock:fd.not_in_whitelist -config-whitelist-test.ini -distributed_lock_service_zookeeper.simple_lock_unlock:fd.not_in_whitelist -config-whitelist-test-failed.ini fd.not_in_whitelist +config-test.ini -distributed_lock_service_zookeeper.simple_lock_unlock From c3ffcbb825fa97eb0e30735d201acd8d323c1fac Mon Sep 17 00:00:00 2001 From: levy Date: Wed, 8 Jul 2020 17:39:40 +0800 Subject: [PATCH 03/12] refactor --- src/failure_detector/CMakeLists.txt | 1 + src/failure_detector/tests/config-test.ini | 8 ------- .../tests/config-whitelist-test-failed.ini | 8 ------- .../tests/config-whitelist-test.ini | 8 ------- src/tests/dsn/config-test.ini | 22 ------------------- 5 files changed, 1 insertion(+), 46 deletions(-) diff --git a/src/failure_detector/CMakeLists.txt b/src/failure_detector/CMakeLists.txt index 004f15f078..1f8363803b 100644 --- a/src/failure_detector/CMakeLists.txt +++ b/src/failure_detector/CMakeLists.txt @@ -17,3 +17,4 @@ set(MY_BINPLACES "") dsn_add_static_library() add_subdirectory(tests) + diff --git a/src/failure_detector/tests/config-test.ini b/src/failure_detector/tests/config-test.ini index e0bbb6d013..f89efd580f 100644 --- a/src/failure_detector/tests/config-test.ini +++ b/src/failure_detector/tests/config-test.ini @@ -22,14 +22,6 @@ run = false count = 0 pools = THREAD_POOL_DEFAULT, THREAD_POOL_REPLICATION -[apps.add_server] -type = adder -arguments = -ports = 20201 -run = true -count = 3 -pools = THREAD_POOL_DEFAULT, THREAD_POOL_DLOCK - [apps.test_worker] type = worker arguments = diff --git a/src/failure_detector/tests/config-whitelist-test-failed.ini b/src/failure_detector/tests/config-whitelist-test-failed.ini index f06f122e6f..3aa3f434bf 100644 --- a/src/failure_detector/tests/config-whitelist-test-failed.ini +++ b/src/failure_detector/tests/config-whitelist-test-failed.ini @@ -22,14 +22,6 @@ run = false count = 0 pools = THREAD_POOL_DEFAULT, THREAD_POOL_REPLICATION -[apps.add_server] -type = adder -arguments = -ports = 20201 -run = true -count = 3 -pools = THREAD_POOL_DEFAULT, THREAD_POOL_DLOCK - [apps.test_worker] type = worker arguments = diff --git a/src/failure_detector/tests/config-whitelist-test.ini b/src/failure_detector/tests/config-whitelist-test.ini index 5bc0332430..12581e55b1 100644 --- a/src/failure_detector/tests/config-whitelist-test.ini +++ b/src/failure_detector/tests/config-whitelist-test.ini @@ -22,14 +22,6 @@ run = false count = 0 pools = THREAD_POOL_DEFAULT, THREAD_POOL_REPLICATION -[apps.add_server] -type = adder -arguments = -ports = 20201 -run = true -count = 3 -pools = THREAD_POOL_DEFAULT, THREAD_POOL_DLOCK - [apps.test_worker] type = worker arguments = diff --git a/src/tests/dsn/config-test.ini b/src/tests/dsn/config-test.ini index e0bbb6d013..abac2c1b7c 100644 --- a/src/tests/dsn/config-test.ini +++ b/src/tests/dsn/config-test.ini @@ -30,22 +30,6 @@ run = true count = 3 pools = THREAD_POOL_DEFAULT, THREAD_POOL_DLOCK -[apps.test_worker] -type = worker -arguments = -ports = 40001 -run = true -count = 1 -pools = THREAD_POOL_DEFAULT, THREAD_POOL_FD - -[apps.test_master] -type = master -arguments = -ports = 30001 -run = true -count = 3 -pools = THREAD_POOL_DEFAULT, THREAD_POOL_FD - [core] ;tool = simulator tool = nativerun @@ -111,9 +95,3 @@ partitioned = true hosts_list = localhost:12181 timeout_ms = 30000 logfile = zoolog.log - -[fds_concurrent_test] -total_files = 64 -min_size = 100 -max_size = 150 - From a8de45c4280b1a0032934f1852b7c29dbfcb5221 Mon Sep 17 00:00:00 2001 From: levy Date: Wed, 8 Jul 2020 18:14:38 +0800 Subject: [PATCH 04/12] fix --- src/tests/dsn/gtest.filter | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tests/dsn/gtest.filter b/src/tests/dsn/gtest.filter index 9d145cdc7c..abbe502446 100644 --- a/src/tests/dsn/gtest.filter +++ b/src/tests/dsn/gtest.filter @@ -1,2 +1 @@ -config-test.ini distributed_lock_service_zookeeper.simple_lock_unlock -config-test.ini -distributed_lock_service_zookeeper.simple_lock_unlock +config-test.ini * From c3d5facd9a2cb2618d88c95e15f40f9b90c24fa9 Mon Sep 17 00:00:00 2001 From: levy Date: Wed, 8 Jul 2020 18:23:24 +0800 Subject: [PATCH 05/12] fix --- src/failure_detector/tests/main.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/failure_detector/tests/main.cpp b/src/failure_detector/tests/main.cpp index 89801ce0bf..96823456ec 100644 --- a/src/failure_detector/tests/main.cpp +++ b/src/failure_detector/tests/main.cpp @@ -24,15 +24,6 @@ * THE SOFTWARE. */ -/* - * Description: - * What is this file about? - * - * Revision history: - * xxxx-xx-xx, author, first version - * xxxx-xx-xx, author, fix bug about xxx - */ - #include #ifndef _WIN32 From 1a437ffcae88431b733078f15170a171d6895da1 Mon Sep 17 00:00:00 2001 From: levy Date: Wed, 8 Jul 2020 18:32:21 +0800 Subject: [PATCH 06/12] Revert "fix" This reverts commit a8de45c4280b1a0032934f1852b7c29dbfcb5221. --- src/tests/dsn/gtest.filter | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tests/dsn/gtest.filter b/src/tests/dsn/gtest.filter index abbe502446..9d145cdc7c 100644 --- a/src/tests/dsn/gtest.filter +++ b/src/tests/dsn/gtest.filter @@ -1 +1,2 @@ -config-test.ini * +config-test.ini distributed_lock_service_zookeeper.simple_lock_unlock +config-test.ini -distributed_lock_service_zookeeper.simple_lock_unlock From 1bebf8d26402b19e4ed3f5921babdda461cc4475 Mon Sep 17 00:00:00 2001 From: levy Date: Wed, 8 Jul 2020 19:12:23 +0800 Subject: [PATCH 07/12] zookeeper --- src/CMakeLists.txt | 1 + src/dist/replication/CMakeLists.txt | 1 - .../meta_server/meta_service_app.cpp | 4 +- src/tests/dsn/CMakeLists.txt | 3 - src/tests/dsn/config-test.ini | 8 -- src/tests/dsn/gtest.filter | 3 +- src/tests/dsn/main.cpp | 3 - src/tests/dsn/meta_state_service.cpp | 2 +- src/tests/dsn/restart_zookeeper.sh | 9 -- src/tests/dsn/run.sh | 18 ---- .../replication => }/zookeeper/CMakeLists.txt | 2 + .../distributed_lock_service_zookeeper.cpp | 0 .../distributed_lock_service_zookeeper.h | 0 .../zookeeper/lock_struct.cpp | 0 .../replication => }/zookeeper/lock_struct.h | 0 .../replication => }/zookeeper/lock_types.h | 0 .../meta_state_service_zookeeper.cpp | 0 .../zookeeper/meta_state_service_zookeeper.h | 0 src/zookeeper/tests/CMakeLists.txt | 29 ++++++ src/zookeeper/tests/clear.sh | 3 + src/zookeeper/tests/config-test.ini | 97 +++++++++++++++++++ .../tests}/distributed_lock_zookeeper.cpp | 4 +- src/zookeeper/tests/gtest.filter | 2 + src/zookeeper/tests/main.cpp | 85 ++++++++++++++++ src/zookeeper/tests/run.sh | 30 ++++++ .../zookeeper/zookeeper_error.cpp | 0 .../zookeeper/zookeeper_error.h | 0 .../zookeeper/zookeeper_session.cpp | 0 .../zookeeper/zookeeper_session.h | 0 .../zookeeper/zookeeper_session_mgr.cpp | 0 .../zookeeper/zookeeper_session_mgr.h | 0 31 files changed, 255 insertions(+), 49 deletions(-) delete mode 100755 src/tests/dsn/restart_zookeeper.sh rename src/{dist/replication => }/zookeeper/CMakeLists.txt (95%) rename src/{dist/replication => }/zookeeper/distributed_lock_service_zookeeper.cpp (100%) rename src/{dist/replication => }/zookeeper/distributed_lock_service_zookeeper.h (100%) rename src/{dist/replication => }/zookeeper/lock_struct.cpp (100%) rename src/{dist/replication => }/zookeeper/lock_struct.h (100%) rename src/{dist/replication => }/zookeeper/lock_types.h (100%) rename src/{dist/replication => }/zookeeper/meta_state_service_zookeeper.cpp (100%) rename src/{dist/replication => }/zookeeper/meta_state_service_zookeeper.h (100%) create mode 100644 src/zookeeper/tests/CMakeLists.txt create mode 100755 src/zookeeper/tests/clear.sh create mode 100644 src/zookeeper/tests/config-test.ini rename src/{tests/dsn => zookeeper/tests}/distributed_lock_zookeeper.cpp (98%) create mode 100644 src/zookeeper/tests/gtest.filter create mode 100644 src/zookeeper/tests/main.cpp create mode 100755 src/zookeeper/tests/run.sh rename src/{dist/replication => }/zookeeper/zookeeper_error.cpp (100%) rename src/{dist/replication => }/zookeeper/zookeeper_error.h (100%) rename src/{dist/replication => }/zookeeper/zookeeper_session.cpp (100%) rename src/{dist/replication => }/zookeeper/zookeeper_session.h (100%) rename src/{dist/replication => }/zookeeper/zookeeper_session_mgr.cpp (100%) rename src/{dist/replication => }/zookeeper/zookeeper_session_mgr.h (100%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 83ac6b215b..f7738f8f5b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,4 +4,5 @@ endif() add_subdirectory(core) add_subdirectory(dist) add_subdirectory(failure_detector) +add_subdirectory(zookeeper) add_subdirectory(tests) diff --git a/src/dist/replication/CMakeLists.txt b/src/dist/replication/CMakeLists.txt index f65af9880f..65529b66dc 100644 --- a/src/dist/replication/CMakeLists.txt +++ b/src/dist/replication/CMakeLists.txt @@ -5,6 +5,5 @@ add_subdirectory(tool_lib) add_subdirectory(meta_server) add_subdirectory(lib) add_subdirectory(global_checker) -add_subdirectory(zookeeper) add_subdirectory(test) add_subdirectory(storage_engine) diff --git a/src/dist/replication/meta_server/meta_service_app.cpp b/src/dist/replication/meta_server/meta_service_app.cpp index 11c829335c..90a2fde4f6 100644 --- a/src/dist/replication/meta_server/meta_service_app.cpp +++ b/src/dist/replication/meta_server/meta_service_app.cpp @@ -33,8 +33,8 @@ #include "meta_state_service_simple.h" #include "dist/http/server_info_http_services.h" -#include "dist/replication/zookeeper/distributed_lock_service_zookeeper.h" -#include "dist/replication/zookeeper/meta_state_service_zookeeper.h" +#include "zookeeper/distributed_lock_service_zookeeper.h" +#include "zookeeper/meta_state_service_zookeeper.h" #include "server_load_balancer.h" #include "greedy_load_balancer.h" diff --git a/src/tests/dsn/CMakeLists.txt b/src/tests/dsn/CMakeLists.txt index efe11077a3..790eba7851 100644 --- a/src/tests/dsn/CMakeLists.txt +++ b/src/tests/dsn/CMakeLists.txt @@ -13,9 +13,7 @@ set(MY_PROJ_LIBS dsn_meta_server dsn_replica_server dsn_replication_common - dsn.replication.zookeeper_provider dsn_runtime - zookeeper_mt gtest ) @@ -24,7 +22,6 @@ set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) # Extra files that will be installed set(MY_BINPLACES "${CMAKE_CURRENT_SOURCE_DIR}/run.sh" - "${CMAKE_CURRENT_SOURCE_DIR}/restart_zookeeper.sh" "${CMAKE_CURRENT_SOURCE_DIR}/clear.sh" "${CMAKE_CURRENT_SOURCE_DIR}/clear.cmd" "${CMAKE_CURRENT_SOURCE_DIR}/config-test.ini" diff --git a/src/tests/dsn/config-test.ini b/src/tests/dsn/config-test.ini index abac2c1b7c..b692830588 100644 --- a/src/tests/dsn/config-test.ini +++ b/src/tests/dsn/config-test.ini @@ -22,14 +22,6 @@ run = false count = 0 pools = THREAD_POOL_DEFAULT, THREAD_POOL_REPLICATION -[apps.add_server] -type = adder -arguments = -ports = 20201 -run = true -count = 3 -pools = THREAD_POOL_DEFAULT, THREAD_POOL_DLOCK - [core] ;tool = simulator tool = nativerun diff --git a/src/tests/dsn/gtest.filter b/src/tests/dsn/gtest.filter index 9d145cdc7c..abbe502446 100644 --- a/src/tests/dsn/gtest.filter +++ b/src/tests/dsn/gtest.filter @@ -1,2 +1 @@ -config-test.ini distributed_lock_service_zookeeper.simple_lock_unlock -config-test.ini -distributed_lock_service_zookeeper.simple_lock_unlock +config-test.ini * diff --git a/src/tests/dsn/main.cpp b/src/tests/dsn/main.cpp index 82470d876b..0c6995c5a5 100644 --- a/src/tests/dsn/main.cpp +++ b/src/tests/dsn/main.cpp @@ -46,8 +46,6 @@ int g_test_count = 0; int g_test_ret = 0; -extern void lock_test_init(); - class test_client : public ::dsn::service_app { public: @@ -83,7 +81,6 @@ GTEST_API_ int main(int argc, char **argv) // register all possible services dsn::service_app::register_factory("test"); - lock_test_init(); // specify what services and tools will run in config file, then run if (argc < 2) diff --git a/src/tests/dsn/meta_state_service.cpp b/src/tests/dsn/meta_state_service.cpp index 1fdb0e0694..d5824da9c1 100644 --- a/src/tests/dsn/meta_state_service.cpp +++ b/src/tests/dsn/meta_state_service.cpp @@ -6,7 +6,7 @@ #include #include "dist/replication/meta_server/meta_state_service_simple.h" -#include "dist/replication/zookeeper/meta_state_service_zookeeper.h" +#include "zookeeper/meta_state_service_zookeeper.h" using namespace dsn; using namespace dsn::dist; diff --git a/src/tests/dsn/restart_zookeeper.sh b/src/tests/dsn/restart_zookeeper.sh deleted file mode 100755 index 147046af74..0000000000 --- a/src/tests/dsn/restart_zookeeper.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -pushd ../../../ -while [ 0 -lt 1 ]; do - ./run.sh stop_zk - ./run.sh start_zk - sleep 3 -done -popd diff --git a/src/tests/dsn/run.sh b/src/tests/dsn/run.sh index 00e4d51465..ba179ec724 100755 --- a/src/tests/dsn/run.sh +++ b/src/tests/dsn/run.sh @@ -1,23 +1,5 @@ #!/bin/bash -function prepare_environment() -{ - if [ $1 == "distributed_lock_service_zookeeper.simple_lock_unlock" ]; then - echo "test $1, try to restart to zookeeper service periodically" - ./restart_zookeeper.sh >output.log 2>&1 & - fi -} - -function destroy_environment() -{ - if [ $1 == "distributed_lock_service_zookeeper.simple_lock_unlock" ]; then - echo "stop restart-zookeeper process" - ps aux | grep restart_zookeeper | grep -v "grep" | awk '{print $2}' | xargs kill -9 - echo "make sure the zookeeper is started" - pushd ../../../ && ./run.sh start_zk && popd - fi -} - if [ -z "${REPORT_DIR}" ]; then REPORT_DIR="." fi diff --git a/src/dist/replication/zookeeper/CMakeLists.txt b/src/zookeeper/CMakeLists.txt similarity index 95% rename from src/dist/replication/zookeeper/CMakeLists.txt rename to src/zookeeper/CMakeLists.txt index c10cfc8df2..3f3b927e37 100644 --- a/src/dist/replication/zookeeper/CMakeLists.txt +++ b/src/zookeeper/CMakeLists.txt @@ -16,3 +16,5 @@ set(MY_PROJ_LIBS "") set(MY_BINPLACES "") dsn_add_static_library() + +add_subdirectory(tests) diff --git a/src/dist/replication/zookeeper/distributed_lock_service_zookeeper.cpp b/src/zookeeper/distributed_lock_service_zookeeper.cpp similarity index 100% rename from src/dist/replication/zookeeper/distributed_lock_service_zookeeper.cpp rename to src/zookeeper/distributed_lock_service_zookeeper.cpp diff --git a/src/dist/replication/zookeeper/distributed_lock_service_zookeeper.h b/src/zookeeper/distributed_lock_service_zookeeper.h similarity index 100% rename from src/dist/replication/zookeeper/distributed_lock_service_zookeeper.h rename to src/zookeeper/distributed_lock_service_zookeeper.h diff --git a/src/dist/replication/zookeeper/lock_struct.cpp b/src/zookeeper/lock_struct.cpp similarity index 100% rename from src/dist/replication/zookeeper/lock_struct.cpp rename to src/zookeeper/lock_struct.cpp diff --git a/src/dist/replication/zookeeper/lock_struct.h b/src/zookeeper/lock_struct.h similarity index 100% rename from src/dist/replication/zookeeper/lock_struct.h rename to src/zookeeper/lock_struct.h diff --git a/src/dist/replication/zookeeper/lock_types.h b/src/zookeeper/lock_types.h similarity index 100% rename from src/dist/replication/zookeeper/lock_types.h rename to src/zookeeper/lock_types.h diff --git a/src/dist/replication/zookeeper/meta_state_service_zookeeper.cpp b/src/zookeeper/meta_state_service_zookeeper.cpp similarity index 100% rename from src/dist/replication/zookeeper/meta_state_service_zookeeper.cpp rename to src/zookeeper/meta_state_service_zookeeper.cpp diff --git a/src/dist/replication/zookeeper/meta_state_service_zookeeper.h b/src/zookeeper/meta_state_service_zookeeper.h similarity index 100% rename from src/dist/replication/zookeeper/meta_state_service_zookeeper.h rename to src/zookeeper/meta_state_service_zookeeper.h diff --git a/src/zookeeper/tests/CMakeLists.txt b/src/zookeeper/tests/CMakeLists.txt new file mode 100644 index 0000000000..35c2591bda --- /dev/null +++ b/src/zookeeper/tests/CMakeLists.txt @@ -0,0 +1,29 @@ +set(MY_PROJ_NAME dsn.zookeeper.tests) + +# Source files under CURRENT project directory will be automatically included. +# You can manually set MY_PROJ_SRC to include source files under other directories. +set(MY_PROJ_SRC "") + +# Search mode for source files under CURRENT project directory? +# "GLOB_RECURSE" for recursive search +# "GLOB" for non-recursive search +set(MY_SRC_SEARCH_MODE "GLOB") + +set(MY_PROJ_LIBS + dsn.replication.zookeeper_provider + dsn_runtime + zookeeper_mt + gtest + ) + +set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) + +# Extra files that will be installed +set(MY_BINPLACES + "${CMAKE_CURRENT_SOURCE_DIR}/run.sh" + "${CMAKE_CURRENT_SOURCE_DIR}/clear.sh" + "${CMAKE_CURRENT_SOURCE_DIR}/config-test.ini" + "${CMAKE_CURRENT_SOURCE_DIR}/gtest.filter" +) + +dsn_add_test() diff --git a/src/zookeeper/tests/clear.sh b/src/zookeeper/tests/clear.sh new file mode 100755 index 0000000000..3e8cb2e749 --- /dev/null +++ b/src/zookeeper/tests/clear.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +rm -rf client core* log.* *.log data diff --git a/src/zookeeper/tests/config-test.ini b/src/zookeeper/tests/config-test.ini new file mode 100644 index 0000000000..abac2c1b7c --- /dev/null +++ b/src/zookeeper/tests/config-test.ini @@ -0,0 +1,97 @@ +[apps..default] +run = true +count = 1 +;network.client.RPC_CHANNEL_TCP = dsn::tools::sim_network_provider, 65536 +;network.client.RPC_CHANNEL_UDP = dsn::tools::sim_network_provider, 65536 +;network.server.0.RPC_CHANNEL_TCP = dsn::tools::sim_network_provider, 65536 + +[apps.client] +type = test +arguments = localhost 20101 +run = true +ports = +count = 1 +delay_seconds = 1 +pools = THREAD_POOL_DEFAULT, THREAD_POOL_DLOCK, THREAD_POOL_REPLICATION, THREAD_POOL_REPLICATION_LONG, THREAD_POOL_FDS_SERVICE + +[apps.server] +type = test +arguments = +ports = 20101 +run = false +count = 0 +pools = THREAD_POOL_DEFAULT, THREAD_POOL_REPLICATION + +[apps.add_server] +type = adder +arguments = +ports = 20201 +run = true +count = 3 +pools = THREAD_POOL_DEFAULT, THREAD_POOL_DLOCK + +[core] +;tool = simulator +tool = nativerun + +;toollets = tracer, profiler +;fault_injector +pause_on_start = false + +logging_start_level = LOG_LEVEL_INFORMATION +logging_factory_name = dsn::tools::simple_logger + + +[tools.simple_logger] +fast_flush = true +short_header = false +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 + +[task..default] +is_trace = true +is_profile = true +allow_inline = false +rpc_call_channel = RPC_CHANNEL_TCP +rpc_message_header_format = dsn +rpc_timeout_milliseconds = 5000 + +[task.LPC_AIO_IMMEDIATE_CALLBACK] +is_trace = false +is_profile = false +allow_inline = false + +[task.LPC_RPC_TIMEOUT] +is_trace = false +is_profile = false + +; specification for each thread pool +[threadpool..default] +worker_count = 2 + +[threadpool.THREAD_POOL_DEFAULT] +partitioned = false +worker_priority = THREAD_xPRIORITY_NORMAL + +[threadpool.THREAD_POOL_TEST_SERVER] +partitioned = false + +[threadpool.THREAD_POOL_FDS_SERVICE] +worker_count = 8 + +[threadpool.THREAD_POOL_DLOCK] +partitioned = true + +[zookeeper] +hosts_list = localhost:12181 +timeout_ms = 30000 +logfile = zoolog.log diff --git a/src/tests/dsn/distributed_lock_zookeeper.cpp b/src/zookeeper/tests/distributed_lock_zookeeper.cpp similarity index 98% rename from src/tests/dsn/distributed_lock_zookeeper.cpp rename to src/zookeeper/tests/distributed_lock_zookeeper.cpp index 121d1a05d4..b09b8eae9e 100644 --- a/src/tests/dsn/distributed_lock_zookeeper.cpp +++ b/src/zookeeper/tests/distributed_lock_zookeeper.cpp @@ -8,8 +8,8 @@ #include -#include "dist/replication/zookeeper/distributed_lock_service_zookeeper.h" -#include "dist/replication/zookeeper/lock_struct.h" +#include "zookeeper/distributed_lock_service_zookeeper.h" +#include "zookeeper/lock_struct.h" using namespace dsn; using namespace dsn::dist; diff --git a/src/zookeeper/tests/gtest.filter b/src/zookeeper/tests/gtest.filter new file mode 100644 index 0000000000..9d145cdc7c --- /dev/null +++ b/src/zookeeper/tests/gtest.filter @@ -0,0 +1,2 @@ +config-test.ini distributed_lock_service_zookeeper.simple_lock_unlock +config-test.ini -distributed_lock_service_zookeeper.simple_lock_unlock diff --git a/src/zookeeper/tests/main.cpp b/src/zookeeper/tests/main.cpp new file mode 100644 index 0000000000..f85554e5bc --- /dev/null +++ b/src/zookeeper/tests/main.cpp @@ -0,0 +1,85 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2015 Microsoft Corporation + * + * -=- Robust Distributed System Nucleus (rDSN) -=- + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#ifndef _WIN32 +#include +#include +#endif + +#include +#include + +int g_test_count = 0; +int g_test_ret = 0; + +extern void lock_test_init(); + +class test_client : public ::dsn::service_app +{ +public: + test_client(const dsn::service_app_info *info) : ::dsn::service_app(info) {} + + ::dsn::error_code start(const std::vector &args) + { + int argc = args.size(); + char *argv[20]; + for (int i = 0; i < argc; ++i) { + argv[i] = (char *)(args[i].c_str()); + } + testing::InitGoogleTest(&argc, argv); + g_test_ret = RUN_ALL_TESTS(); + g_test_count = 1; + return ::dsn::ERR_OK; + } + + ::dsn::error_code stop(bool cleanup = false) { return ::dsn::ERR_OK; } +}; + +GTEST_API_ int main(int argc, char **argv) +{ + testing::InitGoogleTest(&argc, argv); + + // register all possible services + dsn::service_app::register_factory("test"); + lock_test_init(); + + // specify what services and tools will run in config file, then run + if (argc < 2) + dsn_run_config("config-test.ini", false); + else + dsn_run_config(argv[1], false); + + while (g_test_count == 0) { + std::this_thread::sleep_for(std::chrono::seconds(1)); + } + +#ifndef ENABLE_GCOV + dsn_exit(g_test_ret); +#endif + return g_test_ret; +} diff --git a/src/zookeeper/tests/run.sh b/src/zookeeper/tests/run.sh new file mode 100755 index 0000000000..ba179ec724 --- /dev/null +++ b/src/zookeeper/tests/run.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +if [ -z "${REPORT_DIR}" ]; then + REPORT_DIR="." +fi + +while read -r -a line; do + test_case=${line[0]} + gtest_filter=${line[1]} + output_xml="${REPORT_DIR}/dsn.tests_${test_case/.ini/.xml}" + echo "============ run dsn.tests ${test_case} with gtest_filter ${gtest_filter} ============" + ./clear.sh + GTEST_OUTPUT="xml:${output_xml}" GTEST_FILTER=${gtest_filter} ./dsn.tests ${test_case} + + if [ $? -ne 0 ]; then + echo "run dsn.tests $test_case failed" + echo "---- ls ----" + ls -l + if find . -name log.1.txt; then + echo "---- tail -n 100 log.1.txt ----" + tail -n 100 `find . -name log.1.txt` + fi + if [ -f core ]; then + echo "---- gdb ./dsn.tests core ----" + gdb ./dsn.tests core -ex "thread apply all bt" -ex "set pagination 0" -batch + fi + exit 1 + fi + echo "============ done dsn.tests ${test_case} with gtest_filter ${gtest_filter} ============" +done Date: Wed, 8 Jul 2020 19:34:48 +0800 Subject: [PATCH 08/12] fix --- src/dist/replication/global_checker/checker.cpp | 2 +- src/dist/replication/meta_server/meta_http_service.cpp | 2 +- src/dist/replication/meta_server/meta_service.cpp | 2 +- .../test/meta_test/unit_test/data_definition_test.cpp | 2 +- .../meta_test/unit_test/meta_duplication_service_test.cpp | 2 +- .../test/meta_test/unit_test/meta_load_balance_test.cpp | 2 +- .../replication/test/meta_test/unit_test/meta_test_base.h | 2 +- .../test/meta_test/unit_test/update_configuration_test.cpp | 2 +- src/dist/replication/test/simple_kv/checker.cpp | 2 +- src/failure_detector/CMakeLists.txt | 5 ++++- .../meta_server_failure_detector.cpp | 6 +++--- .../meta_server_failure_detector.h | 0 src/failure_detector/tests/failure_detector.cpp | 2 +- 13 files changed, 17 insertions(+), 14 deletions(-) rename src/{dist/replication/meta_server => failure_detector}/meta_server_failure_detector.cpp (98%) rename src/{dist/replication/meta_server => failure_detector}/meta_server_failure_detector.h (100%) diff --git a/src/dist/replication/global_checker/checker.cpp b/src/dist/replication/global_checker/checker.cpp index ef6e40ba5b..2045a8c1f5 100644 --- a/src/dist/replication/global_checker/checker.cpp +++ b/src/dist/replication/global_checker/checker.cpp @@ -43,7 +43,7 @@ #include "dist/replication/lib/mutation_log.h" #include "dist/replication/meta_server/meta_service.h" -#include "dist/replication/meta_server/meta_server_failure_detector.h" +#include "failure_detector/meta_server_failure_detector.h" #include "dist/replication/meta_server/server_state.h" namespace dsn { diff --git a/src/dist/replication/meta_server/meta_http_service.cpp b/src/dist/replication/meta_server/meta_http_service.cpp index abe1f63cad..a01a7fe3ca 100644 --- a/src/dist/replication/meta_server/meta_http_service.cpp +++ b/src/dist/replication/meta_server/meta_http_service.cpp @@ -14,7 +14,7 @@ #include #include "meta_http_service.h" -#include "meta_server_failure_detector.h" +#include "failure_detector/meta_server_failure_detector.h" #include "server_load_balancer.h" #include "server_state.h" #include "duplication/meta_duplication_service.h" diff --git a/src/dist/replication/meta_server/meta_service.cpp b/src/dist/replication/meta_server/meta_service.cpp index b1c2a994a7..511c5b6f56 100644 --- a/src/dist/replication/meta_server/meta_service.cpp +++ b/src/dist/replication/meta_server/meta_service.cpp @@ -42,7 +42,7 @@ #include "meta_service.h" #include "server_state.h" -#include "meta_server_failure_detector.h" +#include "failure_detector/meta_server_failure_detector.h" #include "server_load_balancer.h" #include "duplication/meta_duplication_service.h" #include "meta_split_service.h" diff --git a/src/dist/replication/test/meta_test/unit_test/data_definition_test.cpp b/src/dist/replication/test/meta_test/unit_test/data_definition_test.cpp index 68be6b0a98..44859b4abb 100644 --- a/src/dist/replication/test/meta_test/unit_test/data_definition_test.cpp +++ b/src/dist/replication/test/meta_test/unit_test/data_definition_test.cpp @@ -7,7 +7,7 @@ #include "dist/replication/meta_server/meta_service.h" #include "dist/replication/meta_server/server_state.h" -#include "dist/replication/meta_server/meta_server_failure_detector.h" +#include "failure_detector/meta_server_failure_detector.h" #include "dist/replication/meta_server/server_load_balancer.h" #include "dist/replication/test/meta_test/misc/misc.h" diff --git a/src/dist/replication/test/meta_test/unit_test/meta_duplication_service_test.cpp b/src/dist/replication/test/meta_test/unit_test/meta_duplication_service_test.cpp index 8415f2b8ad..5c8a534c36 100644 --- a/src/dist/replication/test/meta_test/unit_test/meta_duplication_service_test.cpp +++ b/src/dist/replication/test/meta_test/unit_test/meta_duplication_service_test.cpp @@ -29,7 +29,7 @@ #include #include "dist/replication/meta_server/server_load_balancer.h" -#include "dist/replication/meta_server/meta_server_failure_detector.h" +#include "failure_detector/meta_server_failure_detector.h" #include "dist/replication/meta_server/meta_http_service.h" #include "dist/replication/meta_server/duplication/meta_duplication_service.h" #include "dist/replication/test/meta_test/misc/misc.h" diff --git a/src/dist/replication/test/meta_test/unit_test/meta_load_balance_test.cpp b/src/dist/replication/test/meta_test/unit_test/meta_load_balance_test.cpp index 08e353df98..533a89da9e 100644 --- a/src/dist/replication/test/meta_test/unit_test/meta_load_balance_test.cpp +++ b/src/dist/replication/test/meta_test/unit_test/meta_load_balance_test.cpp @@ -8,7 +8,7 @@ #include "dist/replication/meta_server/meta_data.h" #include "dist/replication/meta_server/meta_service.h" #include "dist/replication/meta_server/server_state.h" -#include "dist/replication/meta_server/meta_server_failure_detector.h" +#include "failure_detector/meta_server_failure_detector.h" #include "dist/replication/meta_server/greedy_load_balancer.h" #include "dist/replication/test/meta_test/misc/misc.h" #include "dist/replication/test/meta_test/unit_test/meta_test_base.h" diff --git a/src/dist/replication/test/meta_test/unit_test/meta_test_base.h b/src/dist/replication/test/meta_test/unit_test/meta_test_base.h index 0be884bcc1..a96d91d885 100644 --- a/src/dist/replication/test/meta_test/unit_test/meta_test_base.h +++ b/src/dist/replication/test/meta_test/unit_test/meta_test_base.h @@ -5,7 +5,7 @@ #include #include "dist/replication/meta_server/server_load_balancer.h" -#include "dist/replication/meta_server/meta_server_failure_detector.h" +#include "failure_detector/meta_server_failure_detector.h" #include "dist/replication/meta_server/meta_split_service.h" #include "dist/replication/meta_server/meta_bulk_load_service.h" #include "dist/replication/test/meta_test/misc/misc.h" diff --git a/src/dist/replication/test/meta_test/unit_test/update_configuration_test.cpp b/src/dist/replication/test/meta_test/unit_test/update_configuration_test.cpp index a95244d12d..c5e98a9df1 100644 --- a/src/dist/replication/test/meta_test/unit_test/update_configuration_test.cpp +++ b/src/dist/replication/test/meta_test/unit_test/update_configuration_test.cpp @@ -7,7 +7,7 @@ #include "dist/replication/meta_server/meta_service.h" #include "dist/replication/meta_server/server_state.h" #include "dist/replication/meta_server/greedy_load_balancer.h" -#include "dist/replication/meta_server/meta_server_failure_detector.h" +#include "failure_detector/meta_server_failure_detector.h" #include "dist/replication/test/meta_test/misc/misc.h" #include "meta_service_test_app.h" diff --git a/src/dist/replication/test/simple_kv/checker.cpp b/src/dist/replication/test/simple_kv/checker.cpp index f6ca53da0d..e8edd77add 100644 --- a/src/dist/replication/test/simple_kv/checker.cpp +++ b/src/dist/replication/test/simple_kv/checker.cpp @@ -45,7 +45,7 @@ #include "dist/replication/lib/replica_stub.h" #include "dist/replication/lib/mutation_log.h" #include "dist/replication/meta_server/meta_service.h" -#include "dist/replication/meta_server/meta_server_failure_detector.h" +#include "failure_detector/meta_server_failure_detector.h" #include "dist/replication/meta_server/server_state.h" #include "dist/replication/meta_server/server_load_balancer.h" diff --git a/src/failure_detector/CMakeLists.txt b/src/failure_detector/CMakeLists.txt index 1f8363803b..13adc08a1e 100644 --- a/src/failure_detector/CMakeLists.txt +++ b/src/failure_detector/CMakeLists.txt @@ -9,7 +9,10 @@ set(MY_PROJ_SRC "") # "GLOB" for non-recursive search set(MY_SRC_SEARCH_MODE "GLOB") -set(MY_PROJ_LIBS "") +set(MY_PROJ_LIBS + dsn_meta_server + dsn_replication_common +) # Extra files that will be installed set(MY_BINPLACES "") diff --git a/src/dist/replication/meta_server/meta_server_failure_detector.cpp b/src/failure_detector/meta_server_failure_detector.cpp similarity index 98% rename from src/dist/replication/meta_server/meta_server_failure_detector.cpp rename to src/failure_detector/meta_server_failure_detector.cpp index 4e56e0575c..dd71a63c00 100644 --- a/src/dist/replication/meta_server/meta_server_failure_detector.cpp +++ b/src/failure_detector/meta_server_failure_detector.cpp @@ -37,9 +37,9 @@ #include #include #include "meta_server_failure_detector.h" -#include "server_state.h" -#include "meta_service.h" -#include "meta_options.h" +#include "dist/replication/meta_server/server_state.h" +#include "dist/replication/meta_server/meta_service.h" +#include "dist/replication/meta_server/meta_options.h" #include #include diff --git a/src/dist/replication/meta_server/meta_server_failure_detector.h b/src/failure_detector/meta_server_failure_detector.h similarity index 100% rename from src/dist/replication/meta_server/meta_server_failure_detector.h rename to src/failure_detector/meta_server_failure_detector.h diff --git a/src/failure_detector/tests/failure_detector.cpp b/src/failure_detector/tests/failure_detector.cpp index 7a938e4ddf..2cafb06d9c 100644 --- a/src/failure_detector/tests/failure_detector.cpp +++ b/src/failure_detector/tests/failure_detector.cpp @@ -1,4 +1,4 @@ -#include "dist/replication/meta_server/meta_server_failure_detector.h" +#include "failure_detector/meta_server_failure_detector.h" #include "dist/replication/meta_server/meta_options.h" #include "dist/replication/lib/replica_stub.h" From 9de18cfc78da9d6c15aba963940a6fe585da3eef Mon Sep 17 00:00:00 2001 From: levy Date: Thu, 9 Jul 2020 11:03:56 +0800 Subject: [PATCH 09/12] refactor --- src/zookeeper/tests/config-test.ini | 2 +- src/zookeeper/tests/run.sh | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/zookeeper/tests/config-test.ini b/src/zookeeper/tests/config-test.ini index abac2c1b7c..9da37aa60e 100644 --- a/src/zookeeper/tests/config-test.ini +++ b/src/zookeeper/tests/config-test.ini @@ -12,7 +12,7 @@ run = true ports = count = 1 delay_seconds = 1 -pools = THREAD_POOL_DEFAULT, THREAD_POOL_DLOCK, THREAD_POOL_REPLICATION, THREAD_POOL_REPLICATION_LONG, THREAD_POOL_FDS_SERVICE +pools = THREAD_POOL_DEFAULT, THREAD_POOL_DLOCK, THREAD_POOL_REPLICATION, THREAD_POOL_REPLICATION_LONG [apps.server] type = test diff --git a/src/zookeeper/tests/run.sh b/src/zookeeper/tests/run.sh index ba179ec724..42de723e90 100755 --- a/src/zookeeper/tests/run.sh +++ b/src/zookeeper/tests/run.sh @@ -7,13 +7,13 @@ fi while read -r -a line; do test_case=${line[0]} gtest_filter=${line[1]} - output_xml="${REPORT_DIR}/dsn.tests_${test_case/.ini/.xml}" - echo "============ run dsn.tests ${test_case} with gtest_filter ${gtest_filter} ============" + output_xml="${REPORT_DIR}/dsn.zookeeper.tests_${test_case/.ini/.xml}" + echo "============ run dsn.zookeeper.tests ${test_case} with gtest_filter ${gtest_filter} ============" ./clear.sh - GTEST_OUTPUT="xml:${output_xml}" GTEST_FILTER=${gtest_filter} ./dsn.tests ${test_case} + GTEST_OUTPUT="xml:${output_xml}" GTEST_FILTER=${gtest_filter} ./dsn.zookeeper.tests ${test_case} if [ $? -ne 0 ]; then - echo "run dsn.tests $test_case failed" + echo "run dsn.zookeeper.tests $test_case failed" echo "---- ls ----" ls -l if find . -name log.1.txt; then @@ -21,10 +21,10 @@ while read -r -a line; do tail -n 100 `find . -name log.1.txt` fi if [ -f core ]; then - echo "---- gdb ./dsn.tests core ----" - gdb ./dsn.tests core -ex "thread apply all bt" -ex "set pagination 0" -batch + echo "---- gdb ./dsn.zookeeper.tests core ----" + gdb ./dsn.zookeeper.tests core -ex "thread apply all bt" -ex "set pagination 0" -batch fi exit 1 fi - echo "============ done dsn.tests ${test_case} with gtest_filter ${gtest_filter} ============" + echo "============ done dsn.zookeeper.tests ${test_case} with gtest_filter ${gtest_filter} ============" done Date: Thu, 9 Jul 2020 12:12:36 +0800 Subject: [PATCH 10/12] fix --- src/dist/replication/meta_server/meta_service_app.cpp | 2 +- .../meta_server}/meta_state_service_zookeeper.cpp | 6 +++--- .../replication/meta_server}/meta_state_service_zookeeper.h | 0 src/tests/dsn/meta_state_service.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename src/{zookeeper => dist/replication/meta_server}/meta_state_service_zookeeper.cpp (99%) rename src/{zookeeper => dist/replication/meta_server}/meta_state_service_zookeeper.h (100%) diff --git a/src/dist/replication/meta_server/meta_service_app.cpp b/src/dist/replication/meta_server/meta_service_app.cpp index 90a2fde4f6..9716d8755d 100644 --- a/src/dist/replication/meta_server/meta_service_app.cpp +++ b/src/dist/replication/meta_server/meta_service_app.cpp @@ -34,7 +34,7 @@ #include "dist/http/server_info_http_services.h" #include "zookeeper/distributed_lock_service_zookeeper.h" -#include "zookeeper/meta_state_service_zookeeper.h" +#include "meta_state_service_zookeeper.h" #include "server_load_balancer.h" #include "greedy_load_balancer.h" diff --git a/src/zookeeper/meta_state_service_zookeeper.cpp b/src/dist/replication/meta_server/meta_state_service_zookeeper.cpp similarity index 99% rename from src/zookeeper/meta_state_service_zookeeper.cpp rename to src/dist/replication/meta_server/meta_state_service_zookeeper.cpp index c02b4e895e..5090a709e4 100644 --- a/src/zookeeper/meta_state_service_zookeeper.cpp +++ b/src/dist/replication/meta_server/meta_state_service_zookeeper.cpp @@ -38,9 +38,9 @@ #include #include "meta_state_service_zookeeper.h" -#include "zookeeper_session_mgr.h" -#include "zookeeper_session.h" -#include "zookeeper_error.h" +#include "zookeeper/zookeeper_session_mgr.h" +#include "zookeeper/zookeeper_session.h" +#include "zookeeper/zookeeper_error.h" namespace dsn { namespace dist { diff --git a/src/zookeeper/meta_state_service_zookeeper.h b/src/dist/replication/meta_server/meta_state_service_zookeeper.h similarity index 100% rename from src/zookeeper/meta_state_service_zookeeper.h rename to src/dist/replication/meta_server/meta_state_service_zookeeper.h diff --git a/src/tests/dsn/meta_state_service.cpp b/src/tests/dsn/meta_state_service.cpp index d5824da9c1..accdf5f765 100644 --- a/src/tests/dsn/meta_state_service.cpp +++ b/src/tests/dsn/meta_state_service.cpp @@ -6,7 +6,7 @@ #include #include "dist/replication/meta_server/meta_state_service_simple.h" -#include "zookeeper/meta_state_service_zookeeper.h" +#include "dist/replication/meta_server/meta_state_service_zookeeper.h" using namespace dsn; using namespace dsn::dist; From 62c7baa2b841f6d6e56d13b97ade15f3343ff8b3 Mon Sep 17 00:00:00 2001 From: levy Date: Fri, 10 Jul 2020 13:00:29 +0800 Subject: [PATCH 11/12] fix --- src/dist/replication/meta_server/meta_http_service.cpp | 2 +- .../meta_server}/meta_server_failure_detector.cpp | 0 .../replication/meta_server}/meta_server_failure_detector.h | 0 src/dist/replication/meta_server/meta_service.cpp | 2 +- .../test/meta_test/unit_test/data_definition_test.cpp | 2 +- .../meta_test/unit_test/meta_duplication_service_test.cpp | 2 +- .../test/meta_test/unit_test/meta_load_balance_test.cpp | 2 +- .../replication/test/meta_test/unit_test/meta_test_base.h | 2 +- .../test/meta_test/unit_test/update_configuration_test.cpp | 2 +- src/dist/replication/test/simple_kv/checker.cpp | 2 +- src/failure_detector/CMakeLists.txt | 5 +---- src/failure_detector/tests/failure_detector.cpp | 2 +- 12 files changed, 10 insertions(+), 13 deletions(-) rename src/{failure_detector => dist/replication/meta_server}/meta_server_failure_detector.cpp (100%) rename src/{failure_detector => dist/replication/meta_server}/meta_server_failure_detector.h (100%) diff --git a/src/dist/replication/meta_server/meta_http_service.cpp b/src/dist/replication/meta_server/meta_http_service.cpp index a01a7fe3ca..abe1f63cad 100644 --- a/src/dist/replication/meta_server/meta_http_service.cpp +++ b/src/dist/replication/meta_server/meta_http_service.cpp @@ -14,7 +14,7 @@ #include #include "meta_http_service.h" -#include "failure_detector/meta_server_failure_detector.h" +#include "meta_server_failure_detector.h" #include "server_load_balancer.h" #include "server_state.h" #include "duplication/meta_duplication_service.h" diff --git a/src/failure_detector/meta_server_failure_detector.cpp b/src/dist/replication/meta_server/meta_server_failure_detector.cpp similarity index 100% rename from src/failure_detector/meta_server_failure_detector.cpp rename to src/dist/replication/meta_server/meta_server_failure_detector.cpp diff --git a/src/failure_detector/meta_server_failure_detector.h b/src/dist/replication/meta_server/meta_server_failure_detector.h similarity index 100% rename from src/failure_detector/meta_server_failure_detector.h rename to src/dist/replication/meta_server/meta_server_failure_detector.h diff --git a/src/dist/replication/meta_server/meta_service.cpp b/src/dist/replication/meta_server/meta_service.cpp index 511c5b6f56..b1c2a994a7 100644 --- a/src/dist/replication/meta_server/meta_service.cpp +++ b/src/dist/replication/meta_server/meta_service.cpp @@ -42,7 +42,7 @@ #include "meta_service.h" #include "server_state.h" -#include "failure_detector/meta_server_failure_detector.h" +#include "meta_server_failure_detector.h" #include "server_load_balancer.h" #include "duplication/meta_duplication_service.h" #include "meta_split_service.h" diff --git a/src/dist/replication/test/meta_test/unit_test/data_definition_test.cpp b/src/dist/replication/test/meta_test/unit_test/data_definition_test.cpp index 44859b4abb..68be6b0a98 100644 --- a/src/dist/replication/test/meta_test/unit_test/data_definition_test.cpp +++ b/src/dist/replication/test/meta_test/unit_test/data_definition_test.cpp @@ -7,7 +7,7 @@ #include "dist/replication/meta_server/meta_service.h" #include "dist/replication/meta_server/server_state.h" -#include "failure_detector/meta_server_failure_detector.h" +#include "dist/replication/meta_server/meta_server_failure_detector.h" #include "dist/replication/meta_server/server_load_balancer.h" #include "dist/replication/test/meta_test/misc/misc.h" diff --git a/src/dist/replication/test/meta_test/unit_test/meta_duplication_service_test.cpp b/src/dist/replication/test/meta_test/unit_test/meta_duplication_service_test.cpp index 5c8a534c36..8415f2b8ad 100644 --- a/src/dist/replication/test/meta_test/unit_test/meta_duplication_service_test.cpp +++ b/src/dist/replication/test/meta_test/unit_test/meta_duplication_service_test.cpp @@ -29,7 +29,7 @@ #include #include "dist/replication/meta_server/server_load_balancer.h" -#include "failure_detector/meta_server_failure_detector.h" +#include "dist/replication/meta_server/meta_server_failure_detector.h" #include "dist/replication/meta_server/meta_http_service.h" #include "dist/replication/meta_server/duplication/meta_duplication_service.h" #include "dist/replication/test/meta_test/misc/misc.h" diff --git a/src/dist/replication/test/meta_test/unit_test/meta_load_balance_test.cpp b/src/dist/replication/test/meta_test/unit_test/meta_load_balance_test.cpp index 533a89da9e..08e353df98 100644 --- a/src/dist/replication/test/meta_test/unit_test/meta_load_balance_test.cpp +++ b/src/dist/replication/test/meta_test/unit_test/meta_load_balance_test.cpp @@ -8,7 +8,7 @@ #include "dist/replication/meta_server/meta_data.h" #include "dist/replication/meta_server/meta_service.h" #include "dist/replication/meta_server/server_state.h" -#include "failure_detector/meta_server_failure_detector.h" +#include "dist/replication/meta_server/meta_server_failure_detector.h" #include "dist/replication/meta_server/greedy_load_balancer.h" #include "dist/replication/test/meta_test/misc/misc.h" #include "dist/replication/test/meta_test/unit_test/meta_test_base.h" diff --git a/src/dist/replication/test/meta_test/unit_test/meta_test_base.h b/src/dist/replication/test/meta_test/unit_test/meta_test_base.h index a96d91d885..0be884bcc1 100644 --- a/src/dist/replication/test/meta_test/unit_test/meta_test_base.h +++ b/src/dist/replication/test/meta_test/unit_test/meta_test_base.h @@ -5,7 +5,7 @@ #include #include "dist/replication/meta_server/server_load_balancer.h" -#include "failure_detector/meta_server_failure_detector.h" +#include "dist/replication/meta_server/meta_server_failure_detector.h" #include "dist/replication/meta_server/meta_split_service.h" #include "dist/replication/meta_server/meta_bulk_load_service.h" #include "dist/replication/test/meta_test/misc/misc.h" diff --git a/src/dist/replication/test/meta_test/unit_test/update_configuration_test.cpp b/src/dist/replication/test/meta_test/unit_test/update_configuration_test.cpp index c5e98a9df1..a95244d12d 100644 --- a/src/dist/replication/test/meta_test/unit_test/update_configuration_test.cpp +++ b/src/dist/replication/test/meta_test/unit_test/update_configuration_test.cpp @@ -7,7 +7,7 @@ #include "dist/replication/meta_server/meta_service.h" #include "dist/replication/meta_server/server_state.h" #include "dist/replication/meta_server/greedy_load_balancer.h" -#include "failure_detector/meta_server_failure_detector.h" +#include "dist/replication/meta_server/meta_server_failure_detector.h" #include "dist/replication/test/meta_test/misc/misc.h" #include "meta_service_test_app.h" diff --git a/src/dist/replication/test/simple_kv/checker.cpp b/src/dist/replication/test/simple_kv/checker.cpp index e8edd77add..f6ca53da0d 100644 --- a/src/dist/replication/test/simple_kv/checker.cpp +++ b/src/dist/replication/test/simple_kv/checker.cpp @@ -45,7 +45,7 @@ #include "dist/replication/lib/replica_stub.h" #include "dist/replication/lib/mutation_log.h" #include "dist/replication/meta_server/meta_service.h" -#include "failure_detector/meta_server_failure_detector.h" +#include "dist/replication/meta_server/meta_server_failure_detector.h" #include "dist/replication/meta_server/server_state.h" #include "dist/replication/meta_server/server_load_balancer.h" diff --git a/src/failure_detector/CMakeLists.txt b/src/failure_detector/CMakeLists.txt index 13adc08a1e..1f8363803b 100644 --- a/src/failure_detector/CMakeLists.txt +++ b/src/failure_detector/CMakeLists.txt @@ -9,10 +9,7 @@ set(MY_PROJ_SRC "") # "GLOB" for non-recursive search set(MY_SRC_SEARCH_MODE "GLOB") -set(MY_PROJ_LIBS - dsn_meta_server - dsn_replication_common -) +set(MY_PROJ_LIBS "") # Extra files that will be installed set(MY_BINPLACES "") diff --git a/src/failure_detector/tests/failure_detector.cpp b/src/failure_detector/tests/failure_detector.cpp index 2cafb06d9c..7a938e4ddf 100644 --- a/src/failure_detector/tests/failure_detector.cpp +++ b/src/failure_detector/tests/failure_detector.cpp @@ -1,4 +1,4 @@ -#include "failure_detector/meta_server_failure_detector.h" +#include "dist/replication/meta_server/meta_server_failure_detector.h" #include "dist/replication/meta_server/meta_options.h" #include "dist/replication/lib/replica_stub.h" From 831a1d446b9071c0e90b1b29d0f29a515d7e4257 Mon Sep 17 00:00:00 2001 From: levy Date: Fri, 10 Jul 2020 13:12:43 +0800 Subject: [PATCH 12/12] fix --- .../meta_server/meta_server_failure_detector.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dist/replication/meta_server/meta_server_failure_detector.cpp b/src/dist/replication/meta_server/meta_server_failure_detector.cpp index dd71a63c00..4e56e0575c 100644 --- a/src/dist/replication/meta_server/meta_server_failure_detector.cpp +++ b/src/dist/replication/meta_server/meta_server_failure_detector.cpp @@ -37,9 +37,9 @@ #include #include #include "meta_server_failure_detector.h" -#include "dist/replication/meta_server/server_state.h" -#include "dist/replication/meta_server/meta_service.h" -#include "dist/replication/meta_server/meta_options.h" +#include "server_state.h" +#include "meta_service.h" +#include "meta_options.h" #include #include