From 333fdfce0d2a8690ea93d0f01dfb69122ccff6ef Mon Sep 17 00:00:00 2001 From: yawzhang Date: Tue, 3 Dec 2024 16:45:36 +0800 Subject: [PATCH] add current leader if error is NOT_LEADER --- conanfile.py | 2 +- src/lib/homestore_backend/hs_blob_manager.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conanfile.py b/conanfile.py index 211d344..aab7060 100644 --- a/conanfile.py +++ b/conanfile.py @@ -9,7 +9,7 @@ class HomeObjectConan(ConanFile): name = "homeobject" - version = "2.1.13" + version = "2.1.14" homepage = "https://github.com/eBay/HomeObject" description = "Blob Store built on HomeReplication" diff --git a/src/lib/homestore_backend/hs_blob_manager.cpp b/src/lib/homestore_backend/hs_blob_manager.cpp index b471514..75331c8 100644 --- a/src/lib/homestore_backend/hs_blob_manager.cpp +++ b/src/lib/homestore_backend/hs_blob_manager.cpp @@ -101,7 +101,7 @@ BlobManager::AsyncResult< blob_id_t > HSHomeObject::_put_blob(ShardInfo const& s if (!repl_dev->is_leader()) { LOGW("failed to put blob for pg [{}], shard [{}], not leader", pg_id, shard.id); - return folly::makeUnexpected(BlobErrorCode::NOT_LEADER); + return folly::makeUnexpected(BlobError(BlobErrorCode::NOT_LEADER, repl_dev->get_leader_id())); } // Create a put_blob request which allocates for header, key and blob_header, user_key. Data sgs are added later @@ -378,7 +378,7 @@ BlobManager::NullAsyncResult HSHomeObject::_del_blob(ShardInfo const& shard, blo if (!repl_dev->is_leader()) { LOGW("failed to del blob for pg [{}], shard [{}], blob_id [{}], not leader", pg_id, shard.id, blob_id); - return folly::makeUnexpected(BlobErrorCode::NOT_LEADER); + return folly::makeUnexpected(BlobError(BlobErrorCode::NOT_LEADER, repl_dev->get_leader_id())); } // Create an unaligned header request unaligned