diff options
author | Jon Bratseth <jonbratseth@yahoo.com> | 2017-12-19 14:01:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-19 14:01:34 +0100 |
commit | 5223659b6e1c10917f50b2a27b65f85c6a1c1bab (patch) | |
tree | e4b9a5377ca43661beaa8ea3ff722a2be64d2f30 | |
parent | 56f30232bc8eecc741a2163aec5f32792ac8655a (diff) | |
parent | 64b6b155d36d7f0266ea6824934623a26eea5b8f (diff) |
Merge pull request #4485 from vespa-engine/bergum/same-doc-operation-ordering
Fix per doc-id race with multiple document updates against same document
-rw-r--r-- | vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/operationProcessor/OperationProcessor.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/operationProcessor/OperationProcessor.java b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/operationProcessor/OperationProcessor.java index 0a9fe72552c..5907694f55a 100644 --- a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/operationProcessor/OperationProcessor.java +++ b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/operationProcessor/OperationProcessor.java @@ -177,10 +177,14 @@ public class OperationProcessor { docSendInfoByOperationId.remove(endpointResult.getOperationId()); String documentId = documentSendInfo.getDocument().getDocumentId(); - inflightDocumentIds.remove(documentId); - + /** + * If we got a pending operation against this document + * dont't remove it from inflightDocuments and send blocked document operation + */ List<Document> blockedDocuments = blockedDocumentsByDocumentId.get(documentId); - if (! blockedDocuments.isEmpty()) { + if (blockedDocuments.isEmpty()) { + inflightDocumentIds.remove(documentId); + } else { sendToClusters(blockedDocuments.remove(0)); } return result; |