Skip to content

Commit

Permalink
fix solo repldev will be nullptr in map when homestore restart
Browse files Browse the repository at this point in the history
  • Loading branch information
zichanglai committed Oct 7, 2023
1 parent bf8e6fd commit c02c730
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 1 addition & 3 deletions src/lib/replication/service/repl_service_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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));
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c02c730

Please sign in to comment.