@@ -38,7 +38,10 @@ public abstract class ReplicationRequest<Request extends ReplicationRequest<Requ
3838 implements
3939 IndicesRequest {
4040
41+ // superseded
4142 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" );
4245
4346 public static final TimeValue DEFAULT_TIMEOUT = TimeValue .timeValueMinutes (1 );
4447
@@ -126,14 +129,16 @@ public ReplicationRequest(@Nullable ShardId shardId, int reshardSplitShardCountS
126129 index = in .readString ();
127130 }
128131 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 )) {
133138 this .reshardSplitShardCountSummary = in .readInt ();
139+ } else {
140+ this .reshardSplitShardCountSummary = 0 ;
134141 }
135- } else {
136- this .reshardSplitShardCountSummary = 0 ;
137142 }
138143 }
139144
@@ -262,7 +267,9 @@ public void writeTo(StreamOutput out) throws IOException {
262267 out .writeTimeValue (timeout );
263268 out .writeString (index );
264269 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 )) {
266273 out .writeInt (reshardSplitShardCountSummary );
267274 }
268275 }
0 commit comments