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

[YSQL] PG15 Online Upgrade fails with partition tables and incremented catalog version #24922

Open
1 task done
timothy-e opened this issue Nov 14, 2024 · 0 comments
Open
1 task done
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug priority/medium Medium priority issue status/awaiting-triage Issue awaiting triage

Comments

@timothy-e
Copy link
Contributor

timothy-e commented Nov 14, 2024

Jira Link: DB-14057

Description

Add the following lines to the PartitionedTables test

diff --git src/yb/integration-tests/upgrade-tests/pg15_upgrade-test.cc src/yb/integration-tests/upgrade-tests/pg15_upgrade-test.cc
index 36463649e5..36b83ed07b 100644
--- src/yb/integration-tests/upgrade-tests/pg15_upgrade-test.cc
+++ src/yb/integration-tests/upgrade-tests/pg15_upgrade-test.cc
@@ -803,6 +803,9 @@ TEST_F(Pg15UpgradeTest, Matviews) {
 TEST_F(Pg15UpgradeTest, PartitionedTables) {
   // Set up partitioned tables
   ASSERT_OK(ExecuteStatements({
+    "SET yb_non_ddl_txn_for_sys_tables_allowed TO on",
+    "UPDATE pg_yb_catalog_version SET current_version = 10000, last_breaking_version = 10000",
+    "RESET yb_non_ddl_txn_for_sys_tables_allowed",
     "CREATE TABLE t_r (v INT, z TEXT, PRIMARY KEY(v ASC)) PARTITION BY RANGE (v)",
     "CREATE TABLE t_h (v INT, z TEXT, PRIMARY KEY(v ASC)) PARTITION BY HASH (v)",
     "CREATE TABLE t_l (v INT, z TEXT, PRIMARY KEY(v ASC)) PARTITION BY LIST (v)",

Run the test:

./yb_build.sh release --cxx-test pg15_upgrade-test --gtest_filter Pg15UpgradeTest.PartitionedTables

Upgrade fails with pg_restore output:

pg_restore: connecting to database for restore
pg_restore: dropping DATABASE PROPERTIES yugabyte
pg_restore: dropping DATABASE yugabyte
pg_restore: creating DATABASE "yugabyte"
pg_restore: connecting to new database "yugabyte"
pg_restore: creating COMMENT "DATABASE "yugabyte""
pg_restore: creating DATABASE PROPERTIES "yugabyte"
pg_restore: connecting to new database "yugabyte"
pg_restore: creating SCHEMA "public"
pg_restore: creating TABLE "public.t_h"
pg_restore: while PROCESSING TOC:
pg_restore: from TOC entry 212; 1259 16389 TABLE t_h postgres
pg_restore: error: could not execute query: ERROR:  Invalid table definition: Error creating table yugabyte.t_h on the master: Trying to create a new user table during a ysql major version upgrade
Command was: CREATE TABLE "public"."t_h" (
    "v" integer NOT NULL,
    "z" "text",
    CONSTRAINT "t_h_pkey" PRIMARY KEY("v" ASC)
)
PARTITION BY HASH ("v");

Issue Type

kind/bug

Warning: Please confirm that this issue does not contain any sensitive information

  • I confirm this issue does not contain any sensitive information.
@timothy-e timothy-e added area/ysql Yugabyte SQL (YSQL) status/awaiting-triage Issue awaiting triage labels Nov 14, 2024
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug priority/medium Medium priority issue status/awaiting-triage Issue awaiting triage
Projects
None yet
Development

No branches or pull requests

2 participants