diff --git a/conanfile.py b/conanfile.py index 8efcbe60..2d55d711 100644 --- a/conanfile.py +++ b/conanfile.py @@ -9,7 +9,7 @@ class HomeObjectConan(ConanFile): name = "homeobject" - version = "0.13.1" + version = "0.13.2" homepage = "https://github.com/eBay/HomeObject" description = "Blob Store built on HomeReplication" topics = ("ebay") diff --git a/src/lib/homestore_backend/hs_blob_manager.cpp b/src/lib/homestore_backend/hs_blob_manager.cpp index f4910bc8..e479723f 100644 --- a/src/lib/homestore_backend/hs_blob_manager.cpp +++ b/src/lib/homestore_backend/hs_blob_manager.cpp @@ -156,6 +156,9 @@ bool HSHomeObject::on_blob_put_pre_commit(int64_t lsn, sisl::blob const& header, if (ctx) { ctx->promise_.setValue(folly::makeUnexpected(BlobError::SEALED_SHARD)); } // we return false here, so on_blob_put_commit will not be called. // instead, on_blob_put_rollback will be called. + + // TODO: solo_repl_dev not check the returen value of pre_commit. this logic should be added to + // solo_repl_dev,if we get a false from pre_commit, we should call on_blob_put_rollback. return false; } } @@ -190,6 +193,10 @@ void HSHomeObject::on_blob_put_commit(int64_t lsn, sisl::blob const& header, sis repl_result_ctx< BlobManager::Result< BlobInfo > >* ctx{nullptr}; if (hs_ctx != nullptr) { ctx = boost::static_pointer_cast< repl_result_ctx< BlobManager::Result< BlobInfo > > >(hs_ctx).get(); + if (ctx->promise_.isFulfilled()) { + LOGE("on_blob_put_commit promise is already fulfilled in pre_commit"); + return; + } } auto msg_header = r_cast< ReplicationMessageHeader* >(header.bytes); diff --git a/src/lib/homestore_backend/hs_shard_manager.cpp b/src/lib/homestore_backend/hs_shard_manager.cpp index 3a401ae1..b692d56b 100644 --- a/src/lib/homestore_backend/hs_shard_manager.cpp +++ b/src/lib/homestore_backend/hs_shard_manager.cpp @@ -180,8 +180,9 @@ bool HSHomeObject::do_shard_message_pre_commit(int64_t lsn, ReplicationMessageHe switch (header.msg_type) { case ReplicationMessageType::SEAL_SHARD_MSG: { // we can not release chunk here, since if rollback happens, we can not make sure we can get the same chunk. - // it might be selected by other creat_shard after we release it. - // we need to wait for the commit phase to release chunk; + // chunk selector will always return the a chunk of least used, and GC will happen at the time window + // we can not make sure we can get the same chunk as before, so we need to wait for the commit phase to release + // chunk; update_shard_in_map(shard_info); if (ctx) { ctx->promise_.setValue(ShardManager::Result< ShardInfo >(shard_info)); } break;