Skip to content

Conversation

@captainzmc
Copy link
Member

What changes were proposed in this pull request?

In BlockDataStreamOutput, we should write directly to the underlying stream. We should not use BufferPool and ChunkBuffer in BlockDataStreamOutput anymore since we want to avoid buffer copying.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-5599

How was this patch tested?

Existing UT

@captainzmc
Copy link
Member Author

captainzmc commented Aug 20, 2021

Hi @szetszwo @bshashikant @mukul1987
I've removed the BufferPool and ChunkBuffer from BlockDataStreamOutput in this PR.
Also, since BufferPool is removed, Retry and Flush policy will be different, and I think we can discuss their implementations in this PR.

Copy link
Contributor

@szetszwo szetszwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good. Some comments inlined. Thanks.

Comment on lines 359 to 360
// TODO We are no longer using the bufferPool, so we do not need to flush the
// data in it. We can discuss whether add other behaviors here.
Copy link
Contributor

@szetszwo szetszwo Aug 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flush() should wait for all the futures to complete. Move the code below

//executePutBlock(..)
   try {
      CompletableFuture.allOf(futures.toArray(EMPTY_FUTURE_ARRAY)).get();
    } catch (Exception e) {
      LOG.warn("Failed to write all chunks through stream: " + e);
      throw new IOException(e);
    }

from executePutBlock(..) to flush().

} else {
byteBufferList = null;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move the try-catch below to flush() and then call flush() here.

futureMap = new ConcurrentHashMap<>();
}

public CommitWatcher(XceiverClientSpi xceiverClient) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's copy CommitWatcher to a new class, say StreamCommitWatcher? In StreamCommitWatcher, we don't need bufferPool. The commitIndex2flushedDataMap should be different -- it should not use ChunkBuffer anymore.

Copy link
Contributor

@szetszwo szetszwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, the change looks good.

There are some test failures. Could you take a look?

@captainzmc
Copy link
Member Author

+1, the change looks good.

There are some test failures. Could you take a look?

CI runs correctly on my personal branch. It seems the error is not caused by this PR. I will try to re-trigger the CI to make sure this.

@captainzmc
Copy link
Member Author

hi @szetszwo, CI has been running correct. Could you help take another look this PR?

Copy link
Contributor

@szetszwo szetszwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@kaijchen
Copy link
Member

We no longer copy the data into buffer pool. But we still need to retain the ByteBuf until it gets flushed. This retain is for the retry.

@szetszwo
Copy link
Contributor

@bshashikant , @kaijchen , @captainzmc , I suggest that we first make the streaming write working (without retry, checksum, error handling, etc) so that we have something to test. Then, we can add those features. What do you think?

@captainzmc
Copy link
Member Author

captainzmc commented Aug 26, 2021

Agree with @szetszwo.
At present the writing flow of Ozone streaming has working. And our client also had avoided buffer copy.(Although we are currently using star Topology).
I think we can do a simple performance test now. Currently our implementation is very simple, which makes it easier to locate performance issues. We need to address performance issues first.
@bshashikant
In addition, I will test the performance of streaming with checksum enabled and without checksum enabled. To verify checksum's impact on performance. (The default value of io.bytes.per.checksum in HDFS is 512 bytes)Perhaps checksum's performance overhead isn't that high. Let's make sure by testing it first.

szetszwo pushed a commit that referenced this pull request Aug 26, 2021
szetszwo pushed a commit that referenced this pull request Sep 8, 2021
szetszwo pushed a commit that referenced this pull request Oct 1, 2021
szetszwo pushed a commit that referenced this pull request Oct 19, 2021
szetszwo pushed a commit that referenced this pull request Oct 28, 2021
szetszwo pushed a commit that referenced this pull request Nov 15, 2021
szetszwo pushed a commit that referenced this pull request Nov 30, 2021
captainzmc added a commit that referenced this pull request Dec 20, 2021
szetszwo pushed a commit that referenced this pull request Dec 30, 2021
szetszwo pushed a commit that referenced this pull request Jan 20, 2022
captainzmc added a commit that referenced this pull request Feb 9, 2022
szetszwo pushed a commit that referenced this pull request Feb 16, 2022
szetszwo pushed a commit that referenced this pull request Mar 15, 2022
szetszwo pushed a commit that referenced this pull request Mar 24, 2022
szetszwo pushed a commit to szetszwo/ozone that referenced this pull request May 6, 2022
szetszwo pushed a commit that referenced this pull request May 13, 2022
szetszwo pushed a commit that referenced this pull request May 24, 2022
szetszwo pushed a commit that referenced this pull request Jun 9, 2022
captainzmc added a commit to captainzmc/hadoop-ozone that referenced this pull request Jul 4, 2022
szetszwo pushed a commit that referenced this pull request Oct 25, 2022
…buffer copying (#2557)

(cherry picked from commit b1f1051)
(cherry picked from commit 6b51811d1f0605e95d52441579190865064b9d05)
szetszwo pushed a commit that referenced this pull request Nov 7, 2022
…buffer copying (#2557)

(cherry picked from commit b1f1051)
(cherry picked from commit 6b51811d1f0605e95d52441579190865064b9d05)
(cherry picked from commit ae462a6)
szetszwo pushed a commit that referenced this pull request Dec 1, 2022
szetszwo pushed a commit that referenced this pull request Dec 16, 2022
nishitpatira pushed a commit to nishitpatira/ozone that referenced this pull request Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants