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 CREATE TABLE PARTITION OF #24923

Open
1 task done
timothy-e opened this issue Nov 14, 2024 · 0 comments
Open
1 task done

[YSQL] PG15 Online Upgrade fails with CREATE TABLE PARTITION OF #24923

timothy-e opened this issue Nov 14, 2024 · 0 comments
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-14058

Description

diff --git src/yb/integration-tests/upgrade-tests/pg15_upgrade-test.cc src/yb/integration-tests/upgrade-tests/pg15_upgrade-test.cc
index 36463649e5..d89a2c9c82 100644
--- src/yb/integration-tests/upgrade-tests/pg15_upgrade-test.cc
+++ src/yb/integration-tests/upgrade-tests/pg15_upgrade-test.cc
@@ -977,6 +977,20 @@ TEST_F(Pg15UpgradeTest, PartitionedTables) {
   }
 }

+TEST_F(Pg15UpgradeTest, PartitionedTables2) {
+  // 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 sro_ptab (a int) PARTITION BY RANGE (a)",
+    "CREATE TABLE sro_part PARTITION OF sro_ptab FOR VALUES FROM (1) TO (10)",
+  }));
+  ASSERT_OK(UpgradeClusterToMixedMode());
+  ASSERT_OK(FinalizeUpgradeFromMixedMode());
+}
+
 class Pg15UpgradeTestWithAuth : public Pg15UpgradeTest {
  public:
   Pg15UpgradeTestWithAuth() = default;

Run the test

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

The 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.sro_ptab"
pg_restore: creating TABLE "public.sro_part"
pg_restore: creating TABLE ATTACH "public.sro_part"
pg_restore: while PROCESSING TOC:
pg_restore: from TOC entry 2807; 0 0 TABLE ATTACH sro_part postgres
pg_restore: error: could not execute query: ERROR:  The catalog snapshot used for this transaction has been invalidated: expected: 10000, got: 1: MISMATCHED_SCHEMA
Command was: ALTER TABLE ONLY "public"."sro_ptab" ATTACH PARTITION "public"."sro_part" FOR VALUES FROM (1) TO (10);

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
@timothy-e timothy-e changed the title [YSQL] [YSQL] PG15 Online Upgrade fails with CREATE TABLE PARTITION OF 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