From 68c82cd113e0a79916ea9fce6546139de7753731 Mon Sep 17 00:00:00 2001 From: Areek Zillur Date: Fri, 7 Oct 2016 17:49:57 -0400 Subject: [PATCH] Revert "fix bug in bulk replication for noop update operation" This reverts commit 42bc2d15bedb0f3b457bbfe06247311b9667b7c9. --- .../action/DocumentWriteRequest.java | 1 - .../action/bulk/TransportShardBulkAction.java | 15 +++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/action/DocumentWriteRequest.java b/core/src/main/java/org/elasticsearch/action/DocumentWriteRequest.java index 490aa7fd326..66ea6401bcc 100644 --- a/core/src/main/java/org/elasticsearch/action/DocumentWriteRequest.java +++ b/core/src/main/java/org/elasticsearch/action/DocumentWriteRequest.java @@ -178,7 +178,6 @@ public abstract class DocumentWriteRequest> /** write a document write (index/delete/update) request*/ public static void writeDocumentRequest(StreamOutput out, DocumentWriteRequest request) throws IOException { - assert request != null : "request must not be null"; if (request instanceof IndexRequest) { out.writeByte((byte) 0); } else if (request instanceof DeleteRequest) { diff --git a/core/src/main/java/org/elasticsearch/action/bulk/TransportShardBulkAction.java b/core/src/main/java/org/elasticsearch/action/bulk/TransportShardBulkAction.java index b25483268fa..9a58817c188 100644 --- a/core/src/main/java/org/elasticsearch/action/bulk/TransportShardBulkAction.java +++ b/core/src/main/java/org/elasticsearch/action/bulk/TransportShardBulkAction.java @@ -168,7 +168,7 @@ public class TransportShardBulkAction extends TransportWriteAction itemRequest = request.items()[requestIndex].request(); preVersions[requestIndex] = itemRequest.version(); preVersionTypes[requestIndex] = itemRequest.versionType(); DocumentWriteRequest.OpType opType = itemRequest.opType(); @@ -196,14 +196,9 @@ public class TransportShardBulkAction extends TransportWriteAction) writeResult.getReplicaRequest()); // add the response setResponse(request.items()[requestIndex], new BulkItemResponse(request.items()[requestIndex].id(), opType, writeResult.getResponse())); } catch (Exception e) { @@ -211,14 +206,14 @@ public class TransportShardBulkAction extends TransportWriteAction documentWriteRequest = request.items()[j].request(); documentWriteRequest.version(preVersions[j]); documentWriteRequest.versionType(preVersionTypes[j]); } throw (ElasticsearchException) e; } BulkItemRequest item = request.items()[requestIndex]; - DocumentWriteRequest documentWriteRequest = item.request(); + DocumentWriteRequest documentWriteRequest = item.request(); if (isConflictException(e)) { logger.trace((Supplier) () -> new ParameterizedMessage("{} failed to execute bulk item ({}) {}", request.shardId(), documentWriteRequest.opType().getLowercase(), request), e);