From 513f2566666e07b3503fbf5da06c3cffcedaa8a9 Mon Sep 17 00:00:00 2001 From: Robert Stupp Date: Mon, 16 Oct 2023 18:38:12 +0200 Subject: [PATCH] SQL+Cassandra: add new `refs` columns to schema check (#7631) --- site/docs/try/server-upgrade.md | 6 +++++- .../storage/cassandra/CassandraBackend.java | 12 +++++++++++- .../versioned/storage/jdbc/JdbcBackend.java | 12 +++++++++++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/site/docs/try/server-upgrade.md b/site/docs/try/server-upgrade.md index 65005b308ce..2bd0b31964c 100644 --- a/site/docs/try/server-upgrade.md +++ b/site/docs/try/server-upgrade.md @@ -9,7 +9,8 @@ in the _To_ column. A red cross in the _Rolling Upgrade_ column means that rolling upgrades for the mentioned versions are not supported and must be avoided. -**Also read the [release notes](releases.md).** +**Also read the [release notes on GitHub](https://github.com/projectnessie/nessie/releases) and the +[release notes page](releases.md).** | Rolling Upgrade Supported | _From_ Nessie version | _To_ Nessie version | |---------------------------|-----------------------|---------------------| @@ -27,6 +28,9 @@ See [Releases](releases.md) for release notes. ## Rolling upgrades target version notes +**Also read the [release notes on GitHub](https://github.com/projectnessie/nessie/releases) and the +[release notes page](releases.md).** + ### Nessie 0.61.0 The serialized format of internal key-indexes got bumped. For a rolling-upgrade to version 0.61.0 or newer, follow these diff --git a/versioned/storage/cassandra/src/main/java/org/projectnessie/versioned/storage/cassandra/CassandraBackend.java b/versioned/storage/cassandra/src/main/java/org/projectnessie/versioned/storage/cassandra/CassandraBackend.java index 50cbeb18084..a3746b8ab20 100644 --- a/versioned/storage/cassandra/src/main/java/org/projectnessie/versioned/storage/cassandra/CassandraBackend.java +++ b/versioned/storage/cassandra/src/main/java/org/projectnessie/versioned/storage/cassandra/CassandraBackend.java @@ -23,9 +23,12 @@ import static java.util.concurrent.TimeUnit.SECONDS; import static org.projectnessie.versioned.storage.cassandra.CassandraConstants.COLS_OBJS_ALL; import static org.projectnessie.versioned.storage.cassandra.CassandraConstants.COL_OBJ_ID; +import static org.projectnessie.versioned.storage.cassandra.CassandraConstants.COL_REFS_CREATED_AT; import static org.projectnessie.versioned.storage.cassandra.CassandraConstants.COL_REFS_DELETED; +import static org.projectnessie.versioned.storage.cassandra.CassandraConstants.COL_REFS_EXTENDED_INFO; import static org.projectnessie.versioned.storage.cassandra.CassandraConstants.COL_REFS_NAME; import static org.projectnessie.versioned.storage.cassandra.CassandraConstants.COL_REFS_POINTER; +import static org.projectnessie.versioned.storage.cassandra.CassandraConstants.COL_REFS_PREVIOUS; import static org.projectnessie.versioned.storage.cassandra.CassandraConstants.COL_REPO_ID; import static org.projectnessie.versioned.storage.cassandra.CassandraConstants.CREATE_TABLE_OBJS; import static org.projectnessie.versioned.storage.cassandra.CassandraConstants.CREATE_TABLE_REFS; @@ -372,7 +375,14 @@ public void setupSchema() { keyspace.get(), TABLE_REFS, CREATE_TABLE_REFS, - Stream.of(COL_REPO_ID, COL_REFS_NAME, COL_REFS_POINTER, COL_REFS_DELETED) + Stream.of( + COL_REPO_ID, + COL_REFS_NAME, + COL_REFS_POINTER, + COL_REFS_DELETED, + COL_REFS_CREATED_AT, + COL_REFS_EXTENDED_INFO, + COL_REFS_PREVIOUS) .collect(Collectors.toSet()), ImmutableMap.of(COL_REPO_ID, NAME.type(), COL_REFS_NAME, NAME.type())); createTableIfNotExists( diff --git a/versioned/storage/jdbc/src/main/java/org/projectnessie/versioned/storage/jdbc/JdbcBackend.java b/versioned/storage/jdbc/src/main/java/org/projectnessie/versioned/storage/jdbc/JdbcBackend.java index 5875fc8541b..7a6cabf2d53 100644 --- a/versioned/storage/jdbc/src/main/java/org/projectnessie/versioned/storage/jdbc/JdbcBackend.java +++ b/versioned/storage/jdbc/src/main/java/org/projectnessie/versioned/storage/jdbc/JdbcBackend.java @@ -21,9 +21,12 @@ import static org.projectnessie.versioned.storage.jdbc.JdbcColumnType.OBJ_ID; import static org.projectnessie.versioned.storage.jdbc.SqlConstants.COLS_OBJS_ALL; import static org.projectnessie.versioned.storage.jdbc.SqlConstants.COL_OBJ_ID; +import static org.projectnessie.versioned.storage.jdbc.SqlConstants.COL_REFS_CREATED_AT; import static org.projectnessie.versioned.storage.jdbc.SqlConstants.COL_REFS_DELETED; +import static org.projectnessie.versioned.storage.jdbc.SqlConstants.COL_REFS_EXTENDED_INFO; import static org.projectnessie.versioned.storage.jdbc.SqlConstants.COL_REFS_NAME; import static org.projectnessie.versioned.storage.jdbc.SqlConstants.COL_REFS_POINTER; +import static org.projectnessie.versioned.storage.jdbc.SqlConstants.COL_REFS_PREVIOUS; import static org.projectnessie.versioned.storage.jdbc.SqlConstants.COL_REPO_ID; import static org.projectnessie.versioned.storage.jdbc.SqlConstants.CREATE_TABLE_OBJS; import static org.projectnessie.versioned.storage.jdbc.SqlConstants.CREATE_TABLE_REFS; @@ -111,7 +114,14 @@ public void setupSchema() { conn, TABLE_REFS, CREATE_TABLE_REFS, - Stream.of(COL_REPO_ID, COL_REFS_NAME, COL_REFS_POINTER, COL_REFS_DELETED) + Stream.of( + COL_REPO_ID, + COL_REFS_NAME, + COL_REFS_POINTER, + COL_REFS_DELETED, + COL_REFS_CREATED_AT, + COL_REFS_EXTENDED_INFO, + COL_REFS_PREVIOUS) .collect(Collectors.toSet()), ImmutableMap.of(COL_REPO_ID, nameTypeId, COL_REFS_NAME, nameTypeId)); createTableIfNotExists(