File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
server/src/main/java/org/elasticsearch Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -196,6 +196,7 @@ static TransportVersion def(int id) {
196196 public static final TransportVersion REMOVE_ALL_APPLICABLE_SELECTOR = def (9_009_0_00 );
197197 public static final TransportVersion SLM_UNHEALTHY_IF_NO_SNAPSHOT_WITHIN = def (9_010_0_00 );
198198 public static final TransportVersion ESQL_SUPPORT_PARTIAL_RESULTS = def (9_011_0_00 );
199+ public static final TransportVersion REPO_CONFLICT_EXCEPTION_UNUSED_STRING = def (9_012_0_00 );
199200
200201 /*
201202 * STOP! READ THIS FIRST! No, really,
Original file line number Diff line number Diff line change 1111
1212import org .elasticsearch .common .io .stream .StreamInput ;
1313import org .elasticsearch .common .io .stream .StreamOutput ;
14- import org .elasticsearch .core .UpdateForV9 ;
1514import org .elasticsearch .rest .RestStatus ;
1615
1716import java .io .IOException ;
1817
18+ import static org .elasticsearch .TransportVersions .REPO_CONFLICT_EXCEPTION_UNUSED_STRING ;
19+
1920/**
2021 * Repository conflict exception
2122 */
@@ -29,16 +30,18 @@ public RestStatus status() {
2930 return RestStatus .CONFLICT ;
3031 }
3132
32- @ UpdateForV9 (owner = UpdateForV9 .Owner .DISTRIBUTED_COORDINATION ) // drop unneeded string from wire format
3333 public RepositoryConflictException (StreamInput in ) throws IOException {
3434 super (in );
35- in .readString ();
35+ if (in .getTransportVersion ().before (REPO_CONFLICT_EXCEPTION_UNUSED_STRING )) {
36+ in .readString ();
37+ }
3638 }
3739
3840 @ Override
39- @ UpdateForV9 (owner = UpdateForV9 .Owner .DISTRIBUTED_COORDINATION ) // drop unneeded string from wire format
4041 protected void writeTo (StreamOutput out , Writer <Throwable > nestedExceptionsWriter ) throws IOException {
4142 super .writeTo (out , nestedExceptionsWriter );
42- out .writeString ("" );
43+ if (out .getTransportVersion ().before (REPO_CONFLICT_EXCEPTION_UNUSED_STRING )) {
44+ out .writeString ("" );
45+ }
4346 }
4447}
You can’t perform that action at this time.
0 commit comments