szetszwo commented on PR #6326:
URL: https://github.com/apache/ozone/pull/6326#issuecomment-1977175855
@xichen01 , thanks for digging out the root cause!
> ... the future put into the executePutBlock of CommitWatcher#futureMap may
be overwritten by the last closed executePutBlock. ...
Is this an existing bug? It seems the previous PR does not cause the bug.
> ... Change the `CommitWatcher#futureMap` ...
Let's don't change it. We may chain the futures as below:
```java
+++
b/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/RatisBlockOutputStream.java
@@ -115,7 +115,9 @@ void updateCommitInfo(XceiverClientReply reply,
List<ChunkBuffer> buffers) {
@Override
void putFlushFuture(long flushPos,
CompletableFuture<ContainerCommandResponseProto> flushFuture) {
- commitWatcher.getFutureMap().put(flushPos, flushFuture);
+ commitWatcher.getFutureMap().compute(flushPos,
+ (key, previous) -> previous == null? flushFuture
+ : previous.thenCombine(flushFuture, (prev, curr) -> curr));
}
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]