From 5398f922e8e5a3c7b2def289f017c4f47c96ce1f Mon Sep 17 00:00:00 2001 From: ywz <649521587@qq.com> Date: Tue, 3 Dec 2024 21:12:56 +0800 Subject: [PATCH] add current leader if error is NOT_LEADER (#237) Co-authored-by: yawzhang --- 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