hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arpit Agarwal (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HDDS-501) AllocateBlockResponse.keyLocation must be an optional field
Date Tue, 18 Sep 2018 21:24:00 GMT
Arpit Agarwal created HDDS-501:
----------------------------------

             Summary: AllocateBlockResponse.keyLocation must be an optional field
                 Key: HDDS-501
                 URL: https://issues.apache.org/jira/browse/HDDS-501
             Project: Hadoop Distributed Data Store
          Issue Type: Bug
            Reporter: Arpit Agarwal
             Fix For: 0.2.1


keyLocation may not be initialized if allocateBlock fails in the following function:
{code:java}
public AllocateBlockResponse allocateBlock(RpcController controller,
    AllocateBlockRequest request) throws ServiceException {
  AllocateBlockResponse.Builder resp =
      AllocateBlockResponse.newBuilder();
  try {
    KeyArgs keyArgs = request.getKeyArgs();
    OmKeyArgs omKeyArgs = new OmKeyArgs.Builder()
        .setVolumeName(keyArgs.getVolumeName())
        .setBucketName(keyArgs.getBucketName())
        .setKeyName(keyArgs.getKeyName())
        .build();
    OmKeyLocationInfo newLocation = impl.allocateBlock(omKeyArgs,
        request.getClientID());
    resp.setKeyLocation(newLocation.getProtobuf());
    resp.setStatus(Status.OK);
  } catch (IOException e) {
    resp.setStatus(exceptionToResponseStatus(e));
  }
  return resp.build();
}{code}

Hence it must be an optional field. Else the protobuf builder exception suppresses the real
issue.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org


Mime
View raw message