Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-501

AllocateBlockResponse.keyLocation must be an optional field

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.2.1
    • Component/s: None
    • Labels:
      None

      Description

      keyLocation may not be initialized if allocateBlock fails in the following function:

      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();
      }

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

        Attachments

          Activity

            People

            • Assignee:
              arp Arpit Agarwal
              Reporter:
              arp Arpit Agarwal

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment