Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix solo repldev will be nullptr in map when homestore restart #199

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.4"
version = "4.5.5"

homepage = "https://github.com/eBay/Homestore"
description = "HomeStore Storage Engine"
Expand Down
2 changes: 1 addition & 1 deletion src/lib/replication/service/repl_service_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not clear how is this fixes the problem. At this time, someone already opened the repl_dev and group_id -> repl_dev has been mapped. So how is this storing by referencing or incrementing the ref_count of repl_dev solves this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but at Line80, this repl_dev will be moved, that is why I changed to make a copy of shared_ptr

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