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 the wbcache dependency chain issue. #291

Merged
merged 1 commit into from
Jan 26, 2024
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 = "5.0.5"
version = "5.0.6"
homepage = "https://github.com/eBay/Homestore"
description = "HomeStore Storage Engine"
topics = ("ebay", "nublox")
Expand Down
7 changes: 5 additions & 2 deletions src/lib/index/wb_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,23 +158,26 @@ std::pair< bool, bool > IndexWBCache::create_chain(IndexBufferPtr& second, Index
auto old_third = third;
if (!second->is_clean()) {
auto new_second = copy_buffer(second, cp_ctx);
chain = second;
second = new_second;
second_copied = true;
}

if (!third->is_clean()) {
auto new_third = copy_buffer(third, cp_ctx);
chain = third;
third = new_third;
third_copied = true;
}

// Append parent(third) to the left child(second).
second->m_next_buffer = third;
third->m_wait_for_leaders.increment(1);
if (chain != second) {
if (second_copied || third_copied) {
// We want buffers to be append to the end of the chain which are related.
// If we split a node multiple times in same or different CP's, each dirty buffer will be
// added to the end of that chain.
// added to the end of that chain. Whichever dependent buffer is dirty, we add this
// parent-left combination to the end of that chain.
while (chain->m_next_buffer.lock() != nullptr) {
chain = chain->m_next_buffer.lock();
}
Expand Down
Loading