Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-4454 Ozone Streaming Write Pipeline
  3. HDDS-5481

Fix stream() and link() method in ContainerStateMachine

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • HDDS-4454
    • None

    Description

      The link() method is missing `Override` annotation.

      The stream() method has a bug: the parsing of request.message is inconsistent with the ContainerStateMachine#startTransaction(), which will be called during the close of the stream. This caused the stream closing issue in our POC.

       

      Here is the details about the issue in stream() method, by diving deep into the Ratis streaming implementation: 

       

      When initializing the stream, we need pass a headerMessage to DataStreamApi#stream().

      DataStreamOutput stream(ByteBuffer headerMessage, RoutingTable routingTable); 
      

      This message will be used again when calling the DataStreamOutput#close, by the primary DataNode, in DataStreamManageMent#startTransaction.

      It is wrapped in a Raft FORWARD request, then unwrapped in the RaftServerImpl#SubmitClientRequestAsync. The filter here is doing the unwrap job.

      TransactionContext context = stateMachine.startTransaction(filterDataStreamRaftClientRequest(request));

      Then it hands the headerMessage to ContainerStateMachine#startTransaction.

       

      In ContainerStateMachine#startTransaction, it's expecting the request.message being a ContainerCommandRequestMessage.

      However, in ContainerStateMachine#stream, it's expecting the same request.message being a ContainerCommandRequestProto.

      So we have to change the ContainerStateMachine#stream to match ContainerStateMachine#startTransaction.

      Attachments

        Issue Links

          Activity

            People

              ckj Kaijie Chen
              ckj Kaijie Chen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: