From c02c730e7fc0bbf496684ea3f7df45969d450f29 Mon Sep 17 00:00:00 2001 From: zilai Date: Sat, 7 Oct 2023 01:06:24 -0700 Subject: [PATCH] fix solo repldev will be nullptr in map when homestore restart --- conanfile.py | 2 +- src/lib/replication/service/repl_service_impl.cpp | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/conanfile.py b/conanfile.py index f26964a2c..1e7364867 100644 --- a/conanfile.py +++ b/conanfile.py @@ -5,7 +5,7 @@ class HomestoreConan(ConanFile): name = "homestore" - version = "4.5.3" + version = "4.5.5" homepage = "https://github.com/eBay/Homestore" description = "HomeStore Storage Engine" diff --git a/src/lib/replication/service/repl_service_impl.cpp b/src/lib/replication/service/repl_service_impl.cpp index c4316ee58..9c01f6ff1 100644 --- a/src/lib/replication/service/repl_service_impl.cpp +++ b/src/lib/replication/service/repl_service_impl.cpp @@ -52,7 +52,6 @@ ReplicationServiceImpl::create_repl_dev(uuid_t group_id, std::set< std::string, superblk< repl_dev_superblk > rd_sb{"repl_dev"}; rd_sb.create(sizeof(repl_dev_superblk)); rd_sb->gid = group_id; - shared< ReplDev > repl_dev = create_repl_dev_instance(rd_sb, false /* load_existing */); listener->set_repl_dev(repl_dev.get()); repl_dev->attach_listener(std::move(listener)); @@ -74,7 +73,7 @@ ReplicationServiceImpl::open_repl_dev(uuid_t group_id, std::unique_ptr< ReplDevL auto it = m_rd_map.find(group_id); if (it != m_rd_map.end()) { // We already loaded the ReplDev, just call the group_id and attach the listener - auto& repl_dev = it->second; + auto repl_dev = it->second; listener->set_repl_dev(repl_dev.get()); repl_dev->attach_listener(std::move(listener)); return make_async_success< shared< ReplDev > >(std::move(repl_dev)); @@ -133,7 +132,6 @@ void ReplicationServiceImpl::rd_super_blk_found(sisl::byte_view const& buf, void rd_sb.load(buf, meta_cookie); HS_DBG_ASSERT_EQ(rd_sb->get_magic(), repl_dev_superblk::REPL_DEV_SB_MAGIC, "Invalid rdev metablk, magic mismatch"); HS_DBG_ASSERT_EQ(rd_sb->get_version(), repl_dev_superblk::REPL_DEV_SB_VERSION, "Invalid version of rdev metablk"); - shared< ReplDev > repl_dev = create_repl_dev_instance(rd_sb, true /* load_existing */); { std::unique_lock lg(m_rd_map_mtx);