From 3834972b3da81eb9c0a8babfebf5e8070b0ebd04 Mon Sep 17 00:00:00 2001 From: Tim Brooks Date: Wed, 11 Aug 2021 07:04:32 -0600 Subject: [PATCH] Ensure indexing_data is compressed appropriately (#76321) Currently resync and bulk requests are not compressed when compression level indexing_data is enabled. Since both of these messages propogate raw source documents, these should be compressed. --- .../main/java/org/elasticsearch/action/bulk/BulkRequest.java | 4 +++- .../elasticsearch/action/resync/ResyncReplicationRequest.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/action/bulk/BulkRequest.java b/server/src/main/java/org/elasticsearch/action/bulk/BulkRequest.java index 4d12cacc516e2..a95811fbe06e7 100644 --- a/server/src/main/java/org/elasticsearch/action/bulk/BulkRequest.java +++ b/server/src/main/java/org/elasticsearch/action/bulk/BulkRequest.java @@ -30,6 +30,7 @@ import org.elasticsearch.core.TimeValue; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.search.fetch.subphase.FetchSourceContext; +import org.elasticsearch.transport.RawIndexingDataTransportRequest; import java.io.IOException; import java.util.ArrayList; @@ -48,7 +49,8 @@ * Note that we only support refresh on the bulk request not per item. * @see org.elasticsearch.client.Client#bulk(BulkRequest) */ -public class BulkRequest extends ActionRequest implements CompositeIndicesRequest, WriteRequest, Accountable { +public class BulkRequest extends ActionRequest + implements CompositeIndicesRequest, WriteRequest, Accountable, RawIndexingDataTransportRequest { private static final long SHALLOW_SIZE = RamUsageEstimator.shallowSizeOfInstance(BulkRequest.class); diff --git a/server/src/main/java/org/elasticsearch/action/resync/ResyncReplicationRequest.java b/server/src/main/java/org/elasticsearch/action/resync/ResyncReplicationRequest.java index 6d4bcae30cc7e..a2f25a349b38f 100644 --- a/server/src/main/java/org/elasticsearch/action/resync/ResyncReplicationRequest.java +++ b/server/src/main/java/org/elasticsearch/action/resync/ResyncReplicationRequest.java @@ -12,6 +12,7 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.index.translog.Translog; +import org.elasticsearch.transport.RawIndexingDataTransportRequest; import java.io.IOException; import java.util.Arrays; @@ -20,7 +21,8 @@ /** * Represents a batch of operations sent from the primary to its replicas during the primary-replica resync. */ -public final class ResyncReplicationRequest extends ReplicatedWriteRequest { +public final class ResyncReplicationRequest extends ReplicatedWriteRequest + implements RawIndexingDataTransportRequest { private final long trimAboveSeqNo; private final Translog.Operation[] operations;