From 9e3516bf1e111c17122e8541c808523a27654b63 Mon Sep 17 00:00:00 2001 From: iliana etaoin <iliana@oxide.computer> Date: Tue, 2 Jul 2024 18:57:44 +0000 Subject: [PATCH] crdb v22.2 upgrade (R10) --- cockroach-admin/src/cockroach_cli.rs | 17 ++++++++--------- nexus/types/src/deployment/planning_input.rs | 4 +++- openapi/nexus-internal.json | 3 ++- tools/cockroachdb_checksums | 7 ++++--- tools/cockroachdb_version | 2 +- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/cockroach-admin/src/cockroach_cli.rs b/cockroach-admin/src/cockroach_cli.rs index 1951866ce7b..c68213e4889 100644 --- a/cockroach-admin/src/cockroach_cli.rs +++ b/cockroach-admin/src/cockroach_cli.rs @@ -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; @@ -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()) } } @@ -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(), @@ -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(), diff --git a/nexus/types/src/deployment/planning_input.rs b/nexus/types/src/deployment/planning_input.rs index 88ce8438ed1..d1416a126d8 100644 --- a/nexus/types/src/deployment/planning_input.rs +++ b/nexus/types/src/deployment/planning_input.rs @@ -235,6 +235,8 @@ impl CockroachDbSettings { pub enum CockroachDbClusterVersion { #[display("22.1")] V22_1, + #[display("22.2")] + V22_2, } impl CockroachDbClusterVersion { @@ -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. diff --git a/openapi/nexus-internal.json b/openapi/nexus-internal.json index 6d380891aa3..fc7520c2d6f 100644 --- a/openapi/nexus-internal.json +++ b/openapi/nexus-internal.json @@ -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": { diff --git a/tools/cockroachdb_checksums b/tools/cockroachdb_checksums index 20b6e237f82..870d8a824dd 100644 --- a/tools/cockroachdb_checksums +++ b/tools/cockroachdb_checksums @@ -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" diff --git a/tools/cockroachdb_version b/tools/cockroachdb_version index 4e11c6a7da1..769d27e2a81 100644 --- a/tools/cockroachdb_version +++ b/tools/cockroachdb_version @@ -1 +1 @@ -v22.1.9 +v22.2.19