Skip to content

Commit

Permalink
Fix arguments to RemoteContainsBlob RPC
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherHogan committed Mar 10, 2021
1 parent b2d988a commit 0b6e9d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
9 changes: 6 additions & 3 deletions src/metadata_management.cc
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,11 @@ std::string LocalGetBlobNameFromId(SharedMemoryContext *context,
MetadataManager *mdm = GetMetadataManagerFromContext(context);
std::string blob_name = ReverseGetFromStorage(mdm, blob_id.as_int,
kMapType_Blob);
std::string result =
blob_name.substr(sizeof(BucketID) * 2, std::string::npos);

std::string result;
if (blob_name.size() > kBucketIdStringSize) {
result = blob_name.substr(kBucketIdStringSize, std::string::npos);
}

return result;
}
Expand Down Expand Up @@ -688,7 +691,7 @@ bool ContainsBlob(SharedMemoryContext *context, RpcContext *rpc,
result = LocalContainsBlob(context, bucket_id, blob_id);
} else {
result = RpcCall<bool>(rpc, target_node, "RemoteContainsBlob", bucket_id,
blob_name);
blob_id);
}
}

Expand Down
5 changes: 2 additions & 3 deletions src/rpc_thallium.cc
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,8 @@ void ThalliumStartRpcServer(SharedMemoryContext *context, RpcContext *rpc,
req.respond(result);
};

auto rpc_get_blob_name_from_id = [context](const request &req, BlobID
blob_id) {
std::string result = LocalGetBlobNameFromId(context, blob_id);
auto rpc_get_blob_name_from_id = [context](const request &req, BlobID id) {
std::string result = LocalGetBlobNameFromId(context, id);

req.respond(result);
};
Expand Down

0 comments on commit 0b6e9d6

Please sign in to comment.