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

Inconsistent Behavior with CREATE TABLE and pg_default Tablespace in Colocated Databases #23410

Closed
yugabyte-ci opened this issue Aug 6, 2024 · 0 comments
Assignees
Labels
jira-originated kind/bug This issue is a bug priority/low Low priority

Comments

@yugabyte-ci
Copy link
Contributor

yugabyte-ci commented Aug 6, 2024

Jira Link: DB-12333

@yugabyte-ci yugabyte-ci added jira-originated kind/bug This issue is a bug priority/low Low priority status/awaiting-triage Issue awaiting triage labels Aug 6, 2024
@yugabyte-ci yugabyte-ci changed the title In create table with tablespace pg_default, behaviour should be similar to default tablespace Inconsistent Behavior with CREATE TABLE and pg_default Tablespace in Colocated Databases Aug 13, 2024
@yugabyte-ci yugabyte-ci removed the status/awaiting-triage Issue awaiting triage label Aug 13, 2024
utkarsh-um-yb added a commit that referenced this issue Sep 12, 2024
…ed databases

Summary:
The command `CREATE TABLE ... TABLESPACE pg_default` in colocated databases was incorrectly creating a separate tablegroup, deviating from expected behavior. This fix ensures it behaves similarly to `CREATE TABLE` by setting `tablespaceId` to `InvalidOid` when using the default tablespace, aligning with PostgreSQL semantics as enforced in [[https://github.com/yugabyte/yugabyte-db/blob/709cd92d01d0149837f2ff5ecba0289ecf775365/src/postgres/src/backend/catalog/heap.c#L356C2-L364C5 | heap.c]].

JIRA: DB-12333

Test Plan:
== Automated Testing ==
- ./yb_build.sh --java-test org.yb.pgsql.TestPgRegressColocatedTablesWithTablespaces#testPgRegressColocatedTablesWithTablespaces

In the above test added a scenario where we try to create a table with `pg_default` tablespace and check that no additional tablegroup is created (`pg_yb_tablegroup` table)

Reviewers: skumar, yguan, aagrawal

Reviewed By: yguan

Subscribers: yql

Differential Revision: https://phorge.dev.yugabyte.com/D37096
jasonyb pushed a commit that referenced this issue Sep 16, 2024
Summary:
 32572f7 [#23629]yugabyted: 2nd node doesn't join if webserver_port is changed
 b2d16eb [PLAT-15182]: Reset config working incorrectly for kubernetes universe
 dd60793 [#23843] YSQL: Do not retry schema mismatch errors that occur as part of a batched execution.
 22b6a47 [#23661] YSQL: Change the default wal_level to logical
 5eb925b [#23410] YSQL: Fix CREATE TABLE with pg_default tablespace in colocated databases
 2c0c0eb [#23913] build: fix ysql conn mgr ASAN issue
 b98984a Disable failing DR local provider tests
 48e3c40 Update YBA HA pre-reqs (#23865)
 9baa0be [docs] Release notes for 2.20.2.4 (#23880)
 a2a74d0 [Docs][Voyager] Added a known-issue in PG and some missing entries from PG compatibility doc (#23906)
 0a738ee [#23336] YSQL: Fix tablespace id update in pg_yb_tablegroup after ALTER TABLE CASCADE
 a0e2c4a [PLAT-15156] Pass pg_max_mem_mb during configure phase
 Excluded: 7f59bd8 [#22519] YSQL: Substitute YBSetRowLockPolicy function with YBGetDocDBWaitPolicy

MERGE:

- yb_pg_publication.out:
  - CREATE PUBLICATION testpub_foralltables FOR ALL TABLES;: YB master
    22b6a47 causes WARNING about
    wal_level not being "logical" to go away.  This warning is only
    present in YB pg15 because YB pg15
    5c5a2a0 was not able to suppress
    this WARNING for this one case (see that commit message for more
    details).
- yb_publication.out:
  - CREATE PUBLICATION testpub FOR ALL TABLES;: (same)
- yb_pg_pg_stat_statements.out
  - Check WAL is generated for the above statements: "DROP TABLE
    pgss_test" row's wal column values change.  Likely related to YB
    master 22b6a47.  Not sure how
    exactly it relates, but since it makes the test closer to the
    original pg_stat_statements.out, take it without question.
- yb_colocated_tables_with_tablespaces.{sql,out}:
  - Explicitly specifying pg_default tablespace must not create a new
    tablegroup: YB master 5eb925b adds
    these queries with SELECT * from system table, and upstream PG
    changes that to include the oid column.  We don't want to show the
    oid column since that can easily change, so replace * with explicit
    column names.

Test Plan: Jenkins: rebase: pg15-cherrypicks

Reviewers: tfoucher, jenkins-bot, stiwary, utkarsh.munjal

Subscribers: yql

Differential Revision: https://phorge.dev.yugabyte.com/D38035
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira-originated kind/bug This issue is a bug priority/low Low priority
Projects
None yet
Development

No branches or pull requests

2 participants