Skip to content

Commit 7f4ce9c

Browse files
authored
[8.17] Update transport and index version id numbers to S_PP (#121380) (#121522)
Backport #121380 to 8.17
1 parent 50d65f9 commit 7f4ce9c

File tree

5 files changed

+181
-166
lines changed

5 files changed

+181
-166
lines changed

docs/internal/Versioning.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ Every change to the transport protocol is represented by a new transport version
3535
higher than all previous transport versions, which then becomes the highest version
3636
recognized by that build of Elasticsearch. The version ids are stored
3737
as constants in the `TransportVersions` class.
38-
Each id has a standard pattern `M_NNN_SS_P`, where:
38+
Each id has a standard pattern `M_NNN_S_PP`, where:
3939
* `M` is the major version
4040
* `NNN` is an incrementing id
41-
* `SS` is used in subsidiary repos amending the default transport protocol
42-
* `P` is used for patches and backports
41+
* `S` is used in subsidiary repos amending the default transport protocol
42+
* `PP` is used for patches and backports
4343

4444
When you make a change to the serialization form of any object,
4545
you need to create a new sequential constant in `TransportVersions`,
4646
introduced in the same PR that adds the change, that increments
4747
the `NNN` component from the previous highest version,
4848
with other components set to zero.
49-
For example, if the previous version number is `8_413_00_1`,
50-
the next version number should be `8_414_00_0`.
49+
For example, if the previous version number is `8_413_0_01`,
50+
the next version number should be `8_414_0_00`.
5151

5252
Once you have defined your constant, you then need to use it
5353
in serialization code. If the transport version is at or above the new id,
@@ -166,7 +166,7 @@ also has that change, and knows about the patch backport ids and what they mean.
166166

167167
Index version is a single incrementing version number for the index data format,
168168
metadata, and associated mappings. It is declared the same way as the
169-
transport version - with the pattern `M_NNN_SS_P`, for the major version, version id,
169+
transport version - with the pattern `M_NNN_S_PP`, for the major version, version id,
170170
subsidiary version id, and patch number respectively.
171171

172172
Index version is stored in index metadata when an index is created,

server/src/main/java/org/elasticsearch/TransportVersion.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,20 +110,20 @@ public static TransportVersion fromString(String str) {
110110
* When a patch version of an existing transport version is created, {@code transportVersion.isPatchFrom(patchVersion)}
111111
* will match any transport version at or above {@code patchVersion} that is also of the same base version.
112112
* <p>
113-
* For example, {@code version.isPatchFrom(8_800_00_4)} will return the following for the given {@code version}:
113+
* For example, {@code version.isPatchFrom(8_800_0_04)} will return the following for the given {@code version}:
114114
* <ul>
115-
* <li>{@code 8_799_00_0.isPatchFrom(8_800_00_4)}: {@code false}</li>
116-
* <li>{@code 8_799_00_9.isPatchFrom(8_800_00_4)}: {@code false}</li>
117-
* <li>{@code 8_800_00_0.isPatchFrom(8_800_00_4)}: {@code false}</li>
118-
* <li>{@code 8_800_00_3.isPatchFrom(8_800_00_4)}: {@code false}</li>
119-
* <li>{@code 8_800_00_4.isPatchFrom(8_800_00_4)}: {@code true}</li>
120-
* <li>{@code 8_800_00_9.isPatchFrom(8_800_00_4)}: {@code true}</li>
121-
* <li>{@code 8_800_01_0.isPatchFrom(8_800_00_4)}: {@code false}</li>
122-
* <li>{@code 8_801_00_0.isPatchFrom(8_800_00_4)}: {@code false}</li>
115+
* <li>{@code 8_799_0_00.isPatchFrom(8_800_0_04)}: {@code false}</li>
116+
* <li>{@code 8_799_0_09.isPatchFrom(8_800_0_04)}: {@code false}</li>
117+
* <li>{@code 8_800_0_00.isPatchFrom(8_800_0_04)}: {@code false}</li>
118+
* <li>{@code 8_800_0_03.isPatchFrom(8_800_0_04)}: {@code false}</li>
119+
* <li>{@code 8_800_0_04.isPatchFrom(8_800_0_04)}: {@code true}</li>
120+
* <li>{@code 8_800_0_49.isPatchFrom(8_800_0_04)}: {@code true}</li>
121+
* <li>{@code 8_800_1_00.isPatchFrom(8_800_0_04)}: {@code false}</li>
122+
* <li>{@code 8_801_0_00.isPatchFrom(8_800_0_04)}: {@code false}</li>
123123
* </ul>
124124
*/
125125
public boolean isPatchFrom(TransportVersion version) {
126-
return onOrAfter(version) && id < version.id + 10 - (version.id % 10);
126+
return onOrAfter(version) && id < version.id + 100 - (version.id % 100);
127127
}
128128

129129
/**

0 commit comments

Comments
 (0)