@@ -38,7 +38,10 @@ public abstract class ReplicationRequest<Request extends ReplicationRequest<Requ
38
38
implements
39
39
IndicesRequest {
40
40
41
+ // superseded
41
42
private static final TransportVersion INDEX_RESHARD_SHARDCOUNT_SUMMARY = TransportVersion .fromName ("index_reshard_shardcount_summary" );
43
+ // bumped to use VInt instead of Int
44
+ private static final TransportVersion INDEX_RESHARD_SHARDCOUNT_SMALL = TransportVersion .fromName ("index_reshard_shardcount_small" );
42
45
43
46
public static final TimeValue DEFAULT_TIMEOUT = TimeValue .timeValueMinutes (1 );
44
47
@@ -126,14 +129,16 @@ public ReplicationRequest(@Nullable ShardId shardId, int reshardSplitShardCountS
126
129
index = in .readString ();
127
130
}
128
131
routedBasedOnClusterVersion = in .readVLong ();
129
- if (in .getTransportVersion ().supports (INDEX_RESHARD_SHARDCOUNT_SUMMARY )) {
130
- if (thinRead ) {
131
- this .reshardSplitShardCountSummary = reshardSplitShardCountSummary ;
132
- } else {
132
+ if (thinRead ) {
133
+ this .reshardSplitShardCountSummary = reshardSplitShardCountSummary ;
134
+ } else {
135
+ if (in .getTransportVersion ().supports (INDEX_RESHARD_SHARDCOUNT_SMALL )) {
136
+ this .reshardSplitShardCountSummary = in .readVInt ();
137
+ } else if (in .getTransportVersion ().supports (INDEX_RESHARD_SHARDCOUNT_SUMMARY )) {
133
138
this .reshardSplitShardCountSummary = in .readInt ();
139
+ } else {
140
+ this .reshardSplitShardCountSummary = 0 ;
134
141
}
135
- } else {
136
- this .reshardSplitShardCountSummary = 0 ;
137
142
}
138
143
}
139
144
@@ -262,7 +267,9 @@ public void writeTo(StreamOutput out) throws IOException {
262
267
out .writeTimeValue (timeout );
263
268
out .writeString (index );
264
269
out .writeVLong (routedBasedOnClusterVersion );
265
- if (out .getTransportVersion ().supports (INDEX_RESHARD_SHARDCOUNT_SUMMARY )) {
270
+ if (out .getTransportVersion ().supports (INDEX_RESHARD_SHARDCOUNT_SMALL )) {
271
+ out .writeVInt (reshardSplitShardCountSummary );
272
+ } else if (out .getTransportVersion ().supports (INDEX_RESHARD_SHARDCOUNT_SUMMARY )) {
266
273
out .writeInt (reshardSplitShardCountSummary );
267
274
}
268
275
}
0 commit comments