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
clusterversion: change string for upgrade versions #115223
Conversation
29ed41f
to
2909a9a
Compare
Open to suggestions if there's something better than |
I'm not sure but if I say "22.2 upgraded step 8" in my head that means the 8th step of the "22.2 upgrade". Of course we both know it is the 22.2 to 23.1 upgrade, but that is lost there. If someone said "22.2 upgrading step 8" I think it could sound like it is either to OR from -- it isn't obviously from in my mind, but seems less obviously (and incorrectly) to? Maybe that's just me though. But I think we could do better if we wanted to: we can put whatever string we want between these parts - it isn't meaningful to the computer. That means we could put the version we're going to in there too, e.g. You might say "but we don't know we're upgrading to 23.1" but we do actually: we only define step 08 in a 23.1 binary, so we know by that point the name of the version we're headed to. We could make a little map in this package called if succ, ok := successors[Verison{Major: v.Major, Minor: v.Minor}]; ok {
return fmt.Sprintf("%d.%d-upgrading-to-%s-step-%03d", v.Major, v.Minor, succ, v.Internal)
}
return fmt.Sprintf("%d.%d-upgrading-step-%03d", v.Major, v.Minor, succ, v.Internal) That said, this is more complicated, and putting literally anything other than just |
Very cool idea. I already added something along those lines that in We can't depend on |
Ehhhh; it's a single-digit entry count map. I'd just hand-write it in roachpb/version.go and then change that code in |
Oh, good point. Yes I agree, we can move the current logic to a test as a cross-check. Nice! |
2909a9a
to
053c6c1
Compare
053c6c1
to
6a1e312
Compare
Done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @DarrylWong, @dt, and @herkolategan)
docs/generated/settings/settings.html
line 279 at r2 (raw file):
<tr><td><div id="setting-trace-zipkin-collector" class="anchored"><code>trace.zipkin.collector</code></div></td><td>string</td><td><code></code></td><td>the address of a Zipkin instance to receive traces, as <host>:<port>. If no port is specified, 9411 will be used.</td><td>Serverless/Dedicated/Self-Hosted</td></tr> <tr><td><div id="setting-ui-display-timezone" class="anchored"><code>ui.display_timezone</code></div></td><td>enumeration</td><td><code>etc/utc</code></td><td>the timezone used to format timestamps in the ui [etc/utc = 0, america/new_york = 1]</td><td>Serverless/Dedicated/Self-Hosted</td></tr> <tr><td><div id="setting-version" class="anchored"><code>version</code></div></td><td>version</td><td><code>1000023.2-upgrading-step-002</code></td><td>set the active cluster version in the format '<major>.<minor>'</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
This is because of the dev offset.. I could move the DevOffset constant there and remove it if necessary.. but it will still look weird: 1000023.2-upgrading-to-24.1-step-002
.
753b95a
to
afbe5ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @DarrylWong, @dt, and @herkolategan)
docs/generated/settings/settings.html
line 279 at r2 (raw file):
Previously, RaduBerinde wrote…
This is because of the dev offset.. I could move the DevOffset constant there and remove it if necessary.. but it will still look weird:
1000023.2-upgrading-to-24.1-step-002
.
Never mind, I made it work.
54bdeb8
to
14f57af
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
TFTR! bors r+ |
bors r- |
Canceled. |
This change moves the implementation of `clusterversion.Key.ReleaseSeries()` to `roachpb`. We now use a hardcoded map of sucessor versions. Epic: none Release note: None
This change concerns cluster versions during upgrade. When starting an upgrade from e.g. 23.3 to 24.1, we start with the cluster version 23.2 and then we go through a sequence of internal versions associated with various upgrade steps. These versions are presented as `23.2-x`, e.g. `23.2-8`. This formatting doesn't make it clear what this version represents. It can also be confusing - `23.2-8` looks very close to `23.2.8` which might be an actual CockroachDB version. This change renames versions during upgrade: `23.2-upgrading-to-24.1-step-008`. The internal part is always formatted to three digits (this is intended to reduce the chance of confusing the internal part to a patch release). Informs: cockroachdb#112629 Release note (general change): Versions during upgrades are renamed, for example `23.2-8` is now `23.2-upgrading-to-24.1-step-008`.
14f57af
to
31521ef
Compare
bors r+ |
Build succeeded: |
In cockroachdb#115223 we improved the string representation of internal versions. This test, however, gets an error generated from a node on an older version that uses the older string format. Here, I change the assertion to match on only part of the error message which is enough to assert that the correct node is reporting it is on an older version. Fixes cockroachdb#115502 Release note: None
115864: roachtest: loosely match error in multitenant-upgrade r=yuzefovich a=stevendanna In #115223 we improved the string representation of internal versions. This test, however, gets an error generated from a node on an older version that uses the older string format. Here, I change the assertion to match on only part of the error message which is enough to assert that the correct node is reporting it is on an older version. Fixes #115502 Release note: None Co-authored-by: Steven Danna <danna@cockroachlabs.com>
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
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
123520: sqlinstance: write backwards compatible binary version r=RaduBerinde a=renatolabs 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 Co-authored-by: Renato Costa <renato@cockroachlabs.com>
clusterversion: move ReleaseSeries functionality to roacphb.Version
This change moves the implementation of
clusterversion.Key.ReleaseSeries()
toroachpb
. We now use ahardcoded map of sucessor versions.
Epic: none
Release note: None
clusterversion: change string for upgrade versions
This change concerns cluster versions during upgrade. When starting an
upgrade from e.g. 23.3 to 24.1, we start with the cluster version 23.2
and then we go through a sequence of internal versions associated with
various upgrade steps. These versions are presented as
23.2-x
, e.g.23.2-8
.This formatting doesn't make it clear what this version represents. It
can also be confusing -
23.2-8
looks very close to23.2.8
whichmight be an actual CockroachDB version.
This change renames versions during upgrade:
23.2-upgrading-to-24.1-step-008
. The internal part is alwaysformatted to three digits (this is intended to reduce the chance of
confusing the internal part to a patch release).
Informs: #112629
Release note (general change): Versions during upgrades are renamed,
for example
23.2-8
is now23.2-upgrading-to-24.1-step-008
.