sqlinstance: write backwards compatible binary version #123520
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We keep track of sql instances in multi-tenant deployments using the
system.sql_instances
table. One of the columns in this table isbinary_version
: this is the encoding of the version that the sqlinstance is running. SQL instances know how to reach each other by
reading from that table (more accurately, setting up a rangefeed on
that table and updating a local cache).
In #115223, we introduced a new, more understandable string
representation of cockroach internal versions. This new format is,
however, backwards incompatible: older releases of cockroach are not
able to parse it. As a result, a mixed-version multi-tenant
deployments may face errors if some of the instances are running an
internal version: the older releases won't be able to parse the new
version format. As a result, the cache will be stale and we might see
query errors and distsql timeouts.
In this commit, we introduce a backwards compatible implementation of
the the string representation of a version. Specifically, we continue
to use the old format if the minimum supported version is less than
24.1 (the version in which the new formatting was added). This commit
should eventually be reverted when we no longer support versions older
than 24.1.
Epic: none
Release note: None