[
https://issues.apache.org/jira/browse/HBASE-19522?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16293785#comment-16293785
]
Hudson commented on HBASE-19522:
--------------------------------
FAILURE: Integrated in Jenkins build HBase-Trunk_matrix #4235 (See
[https://builds.apache.org/job/HBase-Trunk_matrix/4235/])
HBASE-19522 The complete order may be wrong in AsyncBufferedMutatorImpl (zghao:
rev 979767824d37df0e05002fa76402ff2b9e534d50)
* (edit)
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncBufferMutator.java
* (edit)
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncBufferedMutatorImpl.java
> The complete order may be wrong in AsyncBufferedMutatorImpl
> -----------------------------------------------------------
>
> Key: HBASE-19522
> URL: https://issues.apache.org/jira/browse/HBASE-19522
> Project: HBase
> Issue Type: Bug
> Reporter: Guanghao Zhang
> Assignee: Guanghao Zhang
> Fix For: 2.0.0-beta-1
>
> Attachments: HBASE-19522.master.001.patch,
> HBASE-19522.master.002.patch
>
>
> {code}
> List<CompletableFuture<Void>> toComplete = this.futures;
> assert toSend.size() == toComplete.size();
> this.mutations = new ArrayList<>();
> this.futures = new ArrayList<>();
> bufferedSize = 0L;
> Iterator<CompletableFuture<Void>> toCompleteIter = toComplete.iterator();
> for (CompletableFuture<?> future : table.batch(toSend)) {
> future.whenComplete((r, e) -> {
> CompletableFuture<Void> f = toCompleteIter.next(); // Call next in
> callback, so the complete order may different with the future order
> if (e != null) {
> f.completeExceptionally(e);
> } else {
> f.complete(null);
> }
> });
> }
> {code}
> Here we call table.batch to get a list of CompleteFuture for each mutation.
> Then we register a call back for each future. But the problem is we call
> toCompleteIter.next() in the callback. So we may complete the future by a
> wrong order(not same with the mutation order). Meanwhile, as ArrayList is not
> thread safe, so different thread may get same future by toCompleteIter.next().
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)