yugabyte / yugabyte-db

YugabyteDB - the cloud native distributed SQL database for mission-critical applications.
https://www.yugabyte.com
Other
9.02k stars 1.08k forks source link

[YSQL] PG15 Online Upgrade fails with ybgin index #24964

Closed timothy-e closed 1 day ago

timothy-e commented 3 days ago

Jira Link: DB-14102

Description

Add the test:

TEST_F(Pg15UpgradeTest, YbGinTest) {
  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 expression (v tsvector, a text[], j jsonb)",
    "CREATE INDEX ON expression USING ybgin (tsvector_to_array(v))",
  }));
  ASSERT_OK(UpgradeClusterToMixedMode());
  ASSERT_OK(FinalizeUpgradeFromMixedMode());
}

Run the test:

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

The upgrade fails with the pg_restore output:

pg_restore: creating INDEX "public.expression_tsvector_to_array_idx"
pg_restore: while PROCESSING TOC:
pg_restore: from TOC entry 2803; 1259 16387 INDEX expression_tsvector_to_array_idx yugabyte
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: CREATE INDEX "expression_tsvector_to_array_idx" ON "public"."expression" USING "ybgin" ("tsvector_to_array"("v"));

Issue Type

kind/bug

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