Skip to content

Commit b443a8a

Browse files
committed
Tips for collapsing transport versions
1 parent a5f935a commit b443a8a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/internal/Versioning.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,25 @@ usually after each new minor release, to collapse the transport versions
8585
for the previous minor release. An example of such an operation can be found
8686
[here](https://github.com/elastic/elasticsearch/pull/104937).
8787

88+
#### Tips
89+
90+
- We collapse versions only on the `main` branch.
91+
- Use [TransportVersions.csv](../../server/src/main/resources/org/elasticsearch/TransportVersions.csv) as your guide.
92+
- For each release version listed in that file with a corresponding `INITIAL_ELASTICSEARCH_` entry corresponding to that version,
93+
- change the prefix to `V_`
94+
- replace all intervening entries since the previous patch `V_` entry with the new `V_` entry
95+
- look at all uses of the new `V_` entry and look for dead code that can be deleted
96+
97+
For example, if there's a version `1.2.3` in the CSV file,
98+
and `TransportVersions.java` has an entry called `INITIAL_ELASTICSEARCH_1_2_3`,
99+
then:
100+
- rename it to `V_1_2_3`,
101+
- replace any other intervening symbols between `V_1_2_2` and `V_1_2_3` with `V_1_2_3` itself, and
102+
- look through all the uses of the new `V_1_2_3` symbol; if any contain dead code, simplify it.
103+
104+
When in doubt, you can always leave the code as-is.
105+
This is an optional cleanup step that is never required for correctness.
106+
88107
### Minimum compatibility versions
89108

90109
The transport version used between two nodes is determined by the initial handshake

0 commit comments

Comments
 (0)