adoroszlai commented on code in PR #7329:
URL: https://github.com/apache/ozone/pull/7329#discussion_r1820226187
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/protocolPB/OzoneManagerProtocolServerSideTranslatorPB.java:
##########
@@ -215,6 +222,28 @@ private OMResponse internalProcessRequest(OMRequest
request) throws
// Added the assertion.
assert (omClientRequest != null);
OMClientRequest finalOmClientRequest = omClientRequest;
+
+ ClientInvocationId clientInvocationId = ClientInvocationId.valueOf(
+
ClientId.valueOf(UUID.nameUUIDFromBytes(ProtobufRpcEngine.Server.getClientId())),
+ ProtobufRpcEngine.Server.getCallId());
+ RetryCache.Entry cacheEntry =
+
omRatisServer.getServerDivision().getRetryCache().getIfPresent(clientInvocationId);
+ // if this request has been executed before, return the cached result.
+ if (cacheEntry != null) {
+ if (cacheEntry.getReplyFuture().isDone()) {
+ RaftClientReply raftClientReply;
+ try {
+ raftClientReply = cacheEntry.getReplyFuture().get();
+ } catch (ExecutionException ex) {
+ throw new ServiceException(ex.getMessage(), ex);
+ } catch (InterruptedException ex) {
+ Thread.currentThread().interrupt();
+ throw new ServiceException(ex.getMessage(), ex);
+ }
+ return
OMRatisHelper.getOMResponseFromRaftClientReply(raftClientReply);
+ }
+ }
Review Comment:
Summary:
- Ratis does handle replay
- but replay in OM can fail in `preExecute` even before hitting Ratis
- so we workaround that by checking Ratis retry cache before `preExecute`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]