From 7cb45a257552912242c8dc674f0390d6a5fea953 Mon Sep 17 00:00:00 2001 From: Sanal Date: Fri, 19 Jan 2024 13:01:51 -0800 Subject: [PATCH] Add grpc stop for flip service in homestore. (#280) --- conanfile.py | 2 +- src/lib/checkpoint/cp_mgr.cpp | 2 +- src/lib/homestore.cpp | 6 +++++- src/tests/CMakeLists.txt | 9 +++++---- src/tests/test_index_btree.cpp | 4 +--- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/conanfile.py b/conanfile.py index 2f2eb1d15..bb402e1f3 100644 --- a/conanfile.py +++ b/conanfile.py @@ -5,7 +5,7 @@ class HomestoreConan(ConanFile): name = "homestore" - version = "5.0.2" + version = "5.0.3" homepage = "https://github.com/eBay/Homestore" description = "HomeStore Storage Engine" topics = ("ebay", "nublox") diff --git a/src/lib/checkpoint/cp_mgr.cpp b/src/lib/checkpoint/cp_mgr.cpp index 1c8d31810..ad6e3efdb 100644 --- a/src/lib/checkpoint/cp_mgr.cpp +++ b/src/lib/checkpoint/cp_mgr.cpp @@ -275,7 +275,7 @@ void CPManager::start_cp_thread() { auto ctx = std::make_shared< Context >(); // Start a reactor with 9 fibers (8 for sync io) - iomanager.create_reactor("cp_io", iomgr::INTERRUPT_LOOP, 8u, [this, &ctx](bool is_started) { + iomanager.create_reactor("cp_io", iomgr::INTERRUPT_LOOP, 8u, [this, ctx](bool is_started) { if (is_started) { { std::unique_lock< std::mutex > lk{ctx->mtx}; diff --git a/src/lib/homestore.cpp b/src/lib/homestore.cpp index 37213b0d8..8486fc44d 100644 --- a/src/lib/homestore.cpp +++ b/src/lib/homestore.cpp @@ -240,7 +240,7 @@ void HomeStore::shutdown() { if (has_index_service()) { m_index_service->stop(); - // m_index_service.reset(); + // m_index_service.reset(); } if (has_log_service()) { @@ -258,6 +258,10 @@ void HomeStore::shutdown() { m_dev_mgr->close_devices(); m_dev_mgr.reset(); +#ifdef _PRERELEASE + flip::Flip::instance().stop_rpc_server(); +#endif + HomeStore::reset_instance(); LOGINFO("Homestore is completed its shutdown"); } diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index b40528358..a9752a3ef 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -36,8 +36,8 @@ if (${build_nonio_tests}) set(TEST_MEMBTREE_SOURCE_FILES test_mem_btree.cpp) add_executable(test_mem_btree ${TEST_MEMBTREE_SOURCE_FILES}) target_link_libraries(test_mem_btree ${COMMON_TEST_DEPS} GTest::gtest) - # add_test(NAME MemBtree COMMAND test_mem_btree) - # set_tests_properties(MemBtree PROPERTIES TIMEOUT 180) + add_test(NAME MemBtree COMMAND test_mem_btree) + set_tests_properties(MemBtree PROPERTIES TIMEOUT 600) add_executable(test_blk_read_tracker) target_sources(test_blk_read_tracker PRIVATE test_blk_read_tracker.cpp ../lib/blkdata_svc/blk_read_tracker.cpp ../lib/blkalloc/blk.cpp) @@ -72,8 +72,9 @@ if (${io_tests}) set(TEST_INDEXBTREE_SOURCE_FILES test_index_btree.cpp) add_executable(test_index_btree ${TEST_INDEXBTREE_SOURCE_FILES}) target_link_libraries(test_index_btree homestore ${COMMON_TEST_DEPS} GTest::gtest) - # add_test(NAME IndexBtree COMMAND test_index_btree) - # set_property(TEST IndexBtree PROPERTY ENVIRONMENT "ASAN_OPTIONS=detect_stack_use_after_return=true") + add_test(NAME IndexBtree COMMAND test_index_btree) + set_property(TEST IndexBtree PROPERTY ENVIRONMENT "ASAN_OPTIONS=detect_stack_use_after_return=true") + set_tests_properties(IndexBtree PROPERTIES TIMEOUT 600) add_executable(test_data_service) target_sources(test_data_service PRIVATE test_data_service.cpp) diff --git a/src/tests/test_index_btree.cpp b/src/tests/test_index_btree.cpp index 1e833b059..b5d0f903d 100644 --- a/src/tests/test_index_btree.cpp +++ b/src/tests/test_index_btree.cpp @@ -33,7 +33,6 @@ SISL_LOGGING_DECL(test_index_btree) std::vector< std::string > test_common::HSTestHelper::s_dev_names; - // TODO Add tests to do write,remove after recovery. // TODO Test with var len key with io mgr page size is 512. @@ -121,7 +120,7 @@ struct BtreeTest : public BtreeTestHelper< TestType >, public ::testing::Test { } }; -using BtreeTypes = testing::Types< FixedLenBtree, VarKeySizeBtree, VarValueSizeBtree, VarObjSizeBtree >; +using BtreeTypes = testing::Types< FixedLenBtree /* , VarKeySizeBtree, VarValueSizeBtree, VarObjSizeBtree */ >; TYPED_TEST_SUITE(BtreeTest, BtreeTypes); @@ -431,7 +430,6 @@ struct BtreeConcurrentTest : public BtreeTestHelper< TestType >, public ::testin BtreeConcurrentTest* m_test; }; - BtreeConcurrentTest() : testing::Test() { this->m_is_multi_threaded = true; } void SetUp() override {