Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions mooncake-store/src/p2p_client_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ tl::expected<void, ErrorCode> P2PClientService::PutViaRoute(
write_result.error() != ErrorCode::REPLICA_ALREADY_EXISTS) {
LOG(WARNING) << "Remote write to " << endpoint
<< " failed: " << write_result.error();
result = tl::unexpected(write_result.error());
continue; // write failed, attempt next candidate
} else {
// ErrorCode::REPLICA_NUM_EXCEEDED or
Expand Down Expand Up @@ -504,9 +505,10 @@ tl::expected<void, ErrorCode> P2PClientService::Put(const ObjectKey& key,
result.error() != ErrorCode::REPLICA_ALREADY_EXISTS) {
LOG(ERROR) << "Failed to put key: " << key
<< " error: " << result.error();
} else {
// the key exists, just ignore the error
return result;
}
// REPLICA_NUM_EXCEEDED / REPLICA_ALREADY_EXISTS: object already
// stored, treat as success so callers don't retry needlessly.
}

return {};
Comment on lines +508 to 514
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe return the result in the end of P2PClientService::Put is better

Expand Down
Loading