bharatviswa504 commented on a change in pull request #1225: HDDS-1909. Use new
HA code for Non-HA in OM.
URL: https://github.com/apache/hadoop/pull/1225#discussion_r319613353
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/security/OMGetDelegationTokenRequest.java
##########
@@ -101,6 +115,29 @@ public OMClientResponse
validateAndUpdateCache(OzoneManager ozoneManager,
UpdateGetDelegationTokenRequest updateGetDelegationTokenRequest =
getOmRequest().getUpdateGetDelegationTokenRequest();
+ OMResponse.Builder omResponse =
+ OMResponse.newBuilder()
+ .setCmdType(OzoneManagerProtocolProtos.Type.GetDelegationToken)
+ .setStatus(OzoneManagerProtocolProtos.Status.OK)
+ .setSuccess(true);
+
+ OMClientResponse omClientResponse = null;
+
+
+ // If security is not enabled and token request is received, leader
+ // returns token null. So, check here if updatedGetDelegationTokenResponse
+ // has response set or not. If it is not set, then token is null.
+ if (!updateGetDelegationTokenRequest.getGetDelegationTokenResponse()
+ .hasResponse()) {
+ omClientResponse = new OMGetDelegationTokenResponse(null, -1L,
+ omResponse.setGetDelegationTokenResponse(
+ GetDelegationTokenResponseProto.newBuilder()).build());
+ omClientResponse.setFlushFuture(
Review comment:
No, it will not be written to DB. Because we have below code in
OMGetDelegationTokenResponse.
```
if (ozoneTokenIdentifier != null &&
getOMResponse().getStatus() == OzoneManagerProtocolProtos.Status.OK)
{
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]