Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqlinstance: write backwards compatible binary version #123520

Conversation

renatolabs
Copy link
Collaborator

@renatolabs renatolabs commented May 2, 2024

We keep track of sql instances in multi-tenant deployments using the
system.sql_instances table. One of the columns in this table is
binary_version: this is the encoding of the version that the sql
instance 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

@cockroach-teamcity
Copy link
Member

This change is Reviewable

We keep track of sql instances in multi-tenant deployments using the
`system.sql_instances` table. One of the columns in this table is
`binary_version`: this is the encoding of the version that the sql
instance 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 cockroachdb#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
@renatolabs renatolabs force-pushed the rc/sql-instances-version-persistence-fix branch from dd1329f to 2b607a5 Compare May 3, 2024 15:53
@renatolabs renatolabs changed the title version: provide backwards compatible implementation of String sqlinstance: write backwards compatible binary version May 3, 2024
@renatolabs renatolabs marked this pull request as ready for review May 3, 2024 15:55
@renatolabs
Copy link
Collaborator Author

Ownership of this particular area is not clear, but also pinging @cockroachdb/disaster-recovery for awareness as the interim maintainers/triagers of multi-tenant related things.

Copy link
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

@renatolabs
Copy link
Collaborator Author

TFTR!

bors r=RaduBerinde

@craig craig bot merged commit 710bf12 into cockroachdb:master May 6, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants