Skip to content

Commit

Permalink
crdb v22.2 upgrade (R10)
Browse files Browse the repository at this point in the history
  • Loading branch information
iliana committed Jul 3, 2024
1 parent 6efac56 commit 9e3516b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
17 changes: 8 additions & 9 deletions cockroach-admin/src/cockroach_cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use camino::Utf8PathBuf;
use chrono::DateTime;
use chrono::NaiveDateTime;
use chrono::Utc;
use dropshot::HttpError;
use illumos_utils::output_to_exec_error;
Expand Down Expand Up @@ -208,9 +207,9 @@ where
where
E: de::Error,
{
let dt = NaiveDateTime::parse_from_str(v, "%Y-%m-%d %H:%M:%S%.f")
let dt = DateTime::parse_from_str(v, "%Y-%m-%d %H:%M:%S%.f %z %Z")
.map_err(E::custom)?;
Ok(DateTime::from_naive_utc_and_offset(dt, Utc))
Ok(dt.to_utc())
}
}

Expand Down Expand Up @@ -369,7 +368,7 @@ mod tests {
#[test]
fn test_node_status_parse_single_line_from_csv() {
let input = br#"id,address,sql_address,build,started_at,updated_at,locality,is_available,is_live
1,[::1]:42021,[::1]:42021,v22.1.9,2024-05-21 15:19:50.523796,2024-05-21 16:31:28.050069,,true,true"#;
1,[::1]:42021,[::1]:42021,v22.1.9,2024-05-21 15:19:50.523796 +0000 UTC,2024-05-21 16:31:28.050069 +0000 UTC,,true,true"#;
let expected = NodeStatus {
node_id: "1".to_string(),
address: "[::1]:42021".parse().unwrap(),
Expand Down Expand Up @@ -401,11 +400,11 @@ mod tests {
#[test]
fn test_node_status_parse_multiple_lines_from_csv() {
let input = br#"id,address,sql_address,build,started_at,updated_at,locality,is_available,is_live
1,[fd00:1122:3344:109::3]:32221,[fd00:1122:3344:109::3]:32221,v22.1.9-dirty,2024-05-18 19:18:00.597145,2024-05-21 15:22:34.290434,,true,true
2,[fd00:1122:3344:105::3]:32221,[fd00:1122:3344:105::3]:32221,v22.1.9-dirty,2024-05-18 19:17:01.796714,2024-05-21 15:22:34.901268,,true,true
3,[fd00:1122:3344:10b::3]:32221,[fd00:1122:3344:10b::3]:32221,v22.1.9-dirty,2024-05-18 19:18:52.37564,2024-05-21 15:22:36.341146,,true,true
4,[fd00:1122:3344:107::3]:32221,[fd00:1122:3344:107::3]:32221,v22.1.9-dirty,2024-05-18 19:16:22.788276,2024-05-21 15:22:34.897047,,true,true
5,[fd00:1122:3344:108::3]:32221,[fd00:1122:3344:108::3]:32221,v22.1.9-dirty,2024-05-18 19:18:09.196634,2024-05-21 15:22:35.168738,,true,true"#;
1,[fd00:1122:3344:109::3]:32221,[fd00:1122:3344:109::3]:32221,v22.1.9-dirty,2024-05-18 19:18:00.597145 +0000 UTC,2024-05-21 15:22:34.290434 +0000 UTC,,true,true
2,[fd00:1122:3344:105::3]:32221,[fd00:1122:3344:105::3]:32221,v22.1.9-dirty,2024-05-18 19:17:01.796714 +0000 UTC,2024-05-21 15:22:34.901268 +0000 UTC,,true,true
3,[fd00:1122:3344:10b::3]:32221,[fd00:1122:3344:10b::3]:32221,v22.1.9-dirty,2024-05-18 19:18:52.37564 +0000 UTC,2024-05-21 15:22:36.341146 +0000 UTC,,true,true
4,[fd00:1122:3344:107::3]:32221,[fd00:1122:3344:107::3]:32221,v22.1.9-dirty,2024-05-18 19:16:22.788276 +0000 UTC,2024-05-21 15:22:34.897047 +0000 UTC,,true,true
5,[fd00:1122:3344:108::3]:32221,[fd00:1122:3344:108::3]:32221,v22.1.9-dirty,2024-05-18 19:18:09.196634 +0000 UTC,2024-05-21 15:22:35.168738 +0000 UTC,,true,true"#;
let expected = vec![
NodeStatus {
node_id: "1".to_string(),
Expand Down
4 changes: 3 additions & 1 deletion nexus/types/src/deployment/planning_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ impl CockroachDbSettings {
pub enum CockroachDbClusterVersion {
#[display("22.1")]
V22_1,
#[display("22.2")]
V22_2,
}

impl CockroachDbClusterVersion {
Expand All @@ -258,7 +260,7 @@ impl CockroachDbClusterVersion {
/// version specified by `CockroachDbClusterVersion::POLICY`. During "tock"
/// releases, these versions are the same.
pub const NEWLY_INITIALIZED: CockroachDbClusterVersion =
CockroachDbClusterVersion::V22_1;
CockroachDbClusterVersion::V22_2;
}

/// Whether to set `cluster.preserve_downgrade_option` and what to set it to.
Expand Down
3 changes: 2 additions & 1 deletion openapi/nexus-internal.json
Original file line number Diff line number Diff line change
Expand Up @@ -2415,7 +2415,8 @@
"description": "CockroachDB cluster versions we are aware of.\n\nCockroachDB can be upgraded from one major version to the next, e.g. v22.1 -> v22.2. Each major version introduces changes in how it stores data on disk to support new features, and each major version has support for reading the previous version's data so that it can perform an upgrade. The version of the data format is called the \"cluster version\", which is distinct from but related to the software version that's being run.\n\nWhile software version v22.2 is using cluster version v22.1, it's possible to downgrade back to v22.1. Once the cluster version is upgraded, there's no going back.\n\nTo give us some time to evaluate new versions of the software while retaining a downgrade path, we currently deploy new versions of CockroachDB across two releases of the Oxide software, in a \"tick-tock\" model:\n\n- In \"tick\" releases, we upgrade the version of the CockroachDB software to a new major version, and update `CockroachDbClusterVersion::NEWLY_INITIALIZED`. On upgraded racks, the new version is running with the previous cluster version; on newly-initialized racks, the new version is running with the new cluser version. - In \"tock\" releases, we change `CockroachDbClusterVersion::POLICY` to the major version we upgraded to in the last \"tick\" release. This results in a new blueprint that upgrades the cluster version, destroying the downgrade path but allowing us to eventually upgrade to the next release.\n\nThese presently describe major versions of CockroachDB. The order of these must be maintained in the correct order (the first variant must be the earliest version).",
"type": "string",
"enum": [
"V22_1"
"V22_1",
"V22_2"
]
},
"CockroachDbPreserveDowngrade": {
Expand Down
7 changes: 4 additions & 3 deletions tools/cockroachdb_checksums
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
CIDL_SHA256_DARWIN="1ca69e0911af11a73305c3c6f4650b912d70754900b5bf7b80a1d361efe36561"
CIDL_SHA256_LINUX="24c321820e7ee45fa07fe91ac138befe13ad860e41c6ed595ce58823205ff4a9"
CIDL_SHA256_ILLUMOS="f151714ba3a6e02caaaa59727482c36085e60d6bd2fa963938e9a3d8c8a77088"
CIDL_SHA256_DARWIN="79fb1669678b802ae891ec3e005efa801c0f970fec4eb6af7ac89cdb6b991b42"
CIDL_SHA256_DARWIN_ARM64="d79ed93a0a20bf9f9f9a4ac9906f158d6212871101753cd23ede724deea30b8a"
CIDL_SHA256_LINUX="3b48271a6fd62c2e5866b97ff9d5790d945a1d35ebf1815dc972d94327b4355b"
CIDL_SHA256_ILLUMOS="814f0ace379df45bf9137db035b99258cd55af47f32d548f226e966cc86a19a3"
2 changes: 1 addition & 1 deletion tools/cockroachdb_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v22.1.9
v22.2.19

0 comments on commit 9e3516b

Please sign in to comment.