From 701f5c11277aca8efdf271cfe3284c50e7a9cb70 Mon Sep 17 00:00:00 2001 From: Xiaoxi Chen Date: Sun, 21 Apr 2024 00:56:28 +0800 Subject: [PATCH 1/2] compatible with cxxopt. in https://github.com/jarro2783/cxxopts/blob/v3.2.1/include/cxxopts.hpp#L1011-L1018 it checks the (!in), if we read after reaching EOF, the !in will be true which results a incorrect_argument_type exception thrown. we should be very careful to avoid read after reaching eof. Signed-off-by: Xiaoxi Chen --- conanfile.py | 2 +- src/include/homeobject/homeobject.hpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/conanfile.py b/conanfile.py index bcdd450f..2f9bd4c8 100644 --- a/conanfile.py +++ b/conanfile.py @@ -9,7 +9,7 @@ class HomeObjectConan(ConanFile): name = "homeobject" - version = "2.0.1" + version = "2.0.2" homepage = "https://github.com/eBay/HomeObject" description = "Blob Store built on HomeReplication" topics = ("ebay") diff --git a/src/include/homeobject/homeobject.hpp b/src/include/homeobject/homeobject.hpp index 1b49125c..e5a6c5ff 100644 --- a/src/include/homeobject/homeobject.hpp +++ b/src/include/homeobject/homeobject.hpp @@ -22,7 +22,9 @@ struct device_info_t { friend std::istream& operator>>(std::istream& input, device_info_t& di) { std::string i_path, i_type; std::getline(input, i_path, ':'); - std::getline(input, i_type); + if (input.peek() != EOF) { + std::getline(input, i_type); + } di.path = std::filesystem::canonical(i_path); if (i_type == "HDD") { di.type = DevType::HDD; From 3f3ff73671f771446d9baf5a6f6e289b75b6b3e4 Mon Sep 17 00:00:00 2001 From: Xiaoxi Chen Date: Tue, 23 Apr 2024 17:41:16 -0700 Subject: [PATCH 2/2] Reduce #chunks to work around HS issue. HS report no availbe chunk after creating 44K chunks. which is under investigation. Signed-off-by: Xiaoxi Chen --- src/lib/homestore_backend/hs_homeobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/homestore_backend/hs_homeobject.cpp b/src/lib/homestore_backend/hs_homeobject.cpp index 64cc2e8d..431848d4 100644 --- a/src/lib/homestore_backend/hs_homeobject.cpp +++ b/src/lib/homestore_backend/hs_homeobject.cpp @@ -170,7 +170,7 @@ void HSHomeObject::init_homestore() { {HS_SERVICE::REPLICATION, hs_format_params{.dev_type = HSDevType::Data, .size_pct = 99.0, - .num_chunks = 60000, + .num_chunks = 32768, .block_size = _data_block_size, .alloc_type = blk_allocator_type_t::append, .chunk_sel_type = chunk_selector_type_t::CUSTOM}},