Skip to content

Commit

Permalink
Ensure indexing_data is compressed appropriately (#76321)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Tim-Brooks committed Aug 11, 2021
1 parent ae9cb9e commit 82cec18
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.index.mapper.MapperService;
import org.elasticsearch.search.fetch.subphase.FetchSourceContext;
import org.elasticsearch.transport.RawIndexingDataTransportRequest;

import java.io.IOException;
import java.util.ArrayList;
Expand All @@ -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<BulkRequest>, Accountable {
public class BulkRequest extends ActionRequest
implements CompositeIndicesRequest, WriteRequest<BulkRequest>, Accountable, RawIndexingDataTransportRequest {

private static final long SHALLOW_SIZE = RamUsageEstimator.shallowSizeOfInstance(BulkRequest.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.elasticsearch.index.seqno.SequenceNumbers;
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;
Expand All @@ -23,7 +24,8 @@
/**
* Represents a batch of operations sent from the primary to its replicas during the primary-replica resync.
*/
public final class ResyncReplicationRequest extends ReplicatedWriteRequest<ResyncReplicationRequest> {
public final class ResyncReplicationRequest extends ReplicatedWriteRequest<ResyncReplicationRequest>
implements RawIndexingDataTransportRequest {

private final long trimAboveSeqNo;
private final Translog.Operation[] operations;
Expand Down

0 comments on commit 82cec18

Please sign in to comment.