Browse Source

Add information on separated version numbers to Contributing doc (#97449)

Simon Cooper 2 years ago
parent
commit
71c4789d61
1 changed files with 36 additions and 0 deletions
  1. 36 0
      CONTRIBUTING.md

+ 36 - 0
CONTRIBUTING.md

@@ -651,6 +651,42 @@ node cannot continue to operate as a member of the cluster:
 
 Errors like this should be very rare. When in doubt, prefer `WARN` to `ERROR`.
 
+### Version numbers in the Elasticsearch codebase
+
+Starting in 8.8.0, we have separated out the version number representations
+of various aspects of Elasticsearch into their own classes, using their own
+numbering scheme separate to release version. The main ones are
+`TransportVersion` and `IndexVersion`, representing the version of the
+inter-node binary protocol and index data + metadata respectively.
+
+Separated version numbers are comprised of a simple incrementing number,
+with no semantic versioning information. There is no direct mapping between
+separated version numbers and the release version. The versions used by any
+particular instance of Elasticsearch can be obtained by querying `/`
+on the node.
+
+#### Using separated version numbers
+
+Whenever a change is made to a component versioned using a separated version
+number, there are a few rules that need to be followed:
+
+1. Each version number represents a specific modification to that component,
+   and should not be modified once it is defined. Each version is immutable
+   once merged into `main`.
+2. To create a new component version, add a new constant to the respective class
+   using the preceding version number +1, modify the version id string to a new
+   unique string (normally a UUID), and set that constant as the new current
+   version.
+
+The version ID string in the constant definition is not used in the executing
+code; it is there to ensure that if two concurrent pull requests add the same
+version constant, there will be a git conflict on those lines. This is to ensure
+two PRs don't accidentally use the same version constant.
+
+If your pull request has a conflict around your new version constant,
+you need to update your PR from `main` and change your PR to use the next
+available version number.
+
 ### Creating A Distribution
 
 Run all build commands from within the root directory: