From bdb900892669c99b142023931c5602b839ff4571 Mon Sep 17 00:00:00 2001 From: Yaming Kuang Date: Thu, 6 Nov 2025 17:56:00 -0700 Subject: [PATCH 1/2] Issue: avoid log reply for graceful restart --- conanfile.py | 5 +++-- src/lib/homeblks_impl.cpp | 1 + src/lib/homeblks_impl.hpp | 2 ++ src/lib/volume_mgr.cpp | 6 ++++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/conanfile.py b/conanfile.py index 926d2f6..3ffbce4 100644 --- a/conanfile.py +++ b/conanfile.py @@ -9,7 +9,7 @@ class HomeBlocksConan(ConanFile): name = "homeblocks" - version = "4.0.1" + version = "4.0.2" homepage = "https://github.com/eBay/HomeBlocks" description = "Block Store built on HomeStore" @@ -46,7 +46,8 @@ def build_requirements(self): self.test_requires("gtest/1.17.0") def requirements(self): - self.requires("homestore/[^7.0]@oss/master", transitive_headers=True) + #self.requires("homestore/[^7.0]@oss/master", transitive_headers=True) + self.requires("homestore/7.0.1", transitive_headers=True) self.requires("iomgr/[^12.0]@oss/master", transitive_headers=True) self.requires("sisl/[^13.0]@oss/master", transitive_headers=True) diff --git a/src/lib/homeblks_impl.cpp b/src/lib/homeblks_impl.cpp index 640a51b..27dae43 100644 --- a/src/lib/homeblks_impl.cpp +++ b/src/lib/homeblks_impl.cpp @@ -422,6 +422,7 @@ void HomeBlocksImpl::on_hb_meta_blk_found(sisl::byte_view const& buf, void* cook if (sb_->test_flag(SB_FLAGS_GRACEFUL_SHUTDOWN)) { // if it is a gracefuln shutdown, this flag should be set again in shutdown routine; sb_->clear_flag(SB_FLAGS_GRACEFUL_SHUTDOWN); + gracefully_shutdown_ = true; LOGI("System was shutdown gracefully"); } else if (sb_->test_flag(SB_FLAGS_RESTRICTED)) { is_restricted_.store(true); diff --git a/src/lib/homeblks_impl.hpp b/src/lib/homeblks_impl.hpp index c9a9a82..cefeb19 100644 --- a/src/lib/homeblks_impl.hpp +++ b/src/lib/homeblks_impl.hpp @@ -78,6 +78,7 @@ class HomeBlocksImpl : public HomeBlocks, public VolumeManager, public std::enab std::unordered_map< std::string, shared< VolumeIndexTable > > idx_tbl_map_; bool recovery_done_{false}; + bool gracefully_shutdown_{false}; std::mutex sb_lock_; // this lock is only used when FC is triggered; superblk< homeblks_sb_t > sb_; peer_id_t our_uuid_; @@ -161,6 +162,7 @@ class HomeBlocksImpl : public HomeBlocks, public VolumeManager, public std::enab void exit_fc(VolumePtr& vol); bool is_restricted() const { return is_restricted_.load(); } hs_chunk_size_cfg_t get_chunk_size() const; + bool is_graceful_shutdown() const { return gracefully_shutdown_; } public: // public static APIs; diff --git a/src/lib/volume_mgr.cpp b/src/lib/volume_mgr.cpp index e41d52a..95f97cb 100644 --- a/src/lib/volume_mgr.cpp +++ b/src/lib/volume_mgr.cpp @@ -313,6 +313,12 @@ void HomeBlocksImpl::submit_io_batch() { homestore::data_service().submit_io_bat void HomeBlocksImpl::on_write(int64_t lsn, const sisl::blob& header, const sisl::blob& key, const std::vector< homestore::MultiBlkId >& new_blkids, cintrusive< homestore::repl_req_ctx >& ctx) { + + // We are not expecting log reply for a graceful restart; + // if we are in recovery path, we must be recovering from a crash. + DEBUG_ASSERT(ctx != nullptr || !is_graceful_shutdown(), + "repl ctx is null (recovery path) in graceful shutdown scenario, this is not expected!"); + repl_result_ctx< VolumeManager::NullResult >* repl_ctx{nullptr}; if (ctx) { repl_ctx = boost::static_pointer_cast< repl_result_ctx< VolumeManager::NullResult > >(ctx).get(); } auto msg_header = r_cast< MsgHeader* >(const_cast< uint8_t* >(header.cbytes())); From 1b9b507674d645d87572aec82d5d6fbf025ff39c Mon Sep 17 00:00:00 2001 From: Yaming Kuang Date: Mon, 1 Dec 2025 17:49:23 -0700 Subject: [PATCH 2/2] fix conan ver --- conanfile.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/conanfile.py b/conanfile.py index 3ffbce4..21bddf4 100644 --- a/conanfile.py +++ b/conanfile.py @@ -9,7 +9,7 @@ class HomeBlocksConan(ConanFile): name = "homeblocks" - version = "4.0.2" + version = "5.0.2" homepage = "https://github.com/eBay/HomeBlocks" description = "Block Store built on HomeStore" @@ -46,8 +46,7 @@ def build_requirements(self): self.test_requires("gtest/1.17.0") def requirements(self): - #self.requires("homestore/[^7.0]@oss/master", transitive_headers=True) - self.requires("homestore/7.0.1", transitive_headers=True) + self.requires("homestore/[^7.0]@oss/master", transitive_headers=True) self.requires("iomgr/[^12.0]@oss/master", transitive_headers=True) self.requires("sisl/[^13.0]@oss/master", transitive_headers=True)