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

[DocDB][DB Clone][Colocation] Create table/index query timing out in cloned DB #23543

Closed
1 task done
Arjun-yb opened this issue Aug 19, 2024 · 0 comments
Closed
1 task done
Assignees
Labels
2.23_blocker area/docdb YugabyteDB core features DB_Clone kind/bug This issue is a bug priority/highest Highest priority issue

Comments

@Arjun-yb
Copy link
Contributor

Arjun-yb commented Aug 19, 2024

Jira Link: DB-12461

Description

Version: 2.23.0.0-b704

Steps:

  1. Create colocated DB(database_1) and create snapshot schedule on it
  2. Create table(table_1) and load some data(50K rows)
  3. Collect time(t1)
  4. Create another table(table_2)
  5. Clone database_1 to database_2 on collect time(t1)
  6. Connect to cloned DB(Database_2)
  7. Create same table(table_2) or different tables or indexes to table_1

Actual:
in step:7 all create table/index queries are timing out in cloned DB(database_2)
and create table/index queries are working fine in source db(database_1)

in cloned database:

create table t2(id int primary key, name text, age int, description text, c1 int,
c2 text);
ERROR:  Timed out waiting for Create Table

create index idx_1 on t1(description);
ERROR:  Timed out waiting for Create Table

in source database:

create table t3(id int primary key, name text, age int, description text, c1 int,
c2 text);
CREATE TABLE

create index idx_1 on t1(description);
CREATE INDEX

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.
@Arjun-yb Arjun-yb added area/docdb YugabyteDB core features status/awaiting-triage Issue awaiting triage labels Aug 19, 2024
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels Aug 19, 2024
SrivastavaAnubhav added a commit that referenced this issue Aug 26, 2024
Summary:
Previously, the tablegroup manager was not updated when repartitioning a colocated table.
This was causing CREATE TABLE to add tables to the old (deleted) tablet when trying to create tables
on a cloned colocated database. This diff changes `RepartitionTable` to update the tablegroup manager
to point to the new tablet instead of the old one.
Jira: DB-12461

Test Plan: `./yb_build.sh release --cxx-test integration-tests_minicluster-snapshot-test --gtest_filter PgCloneColocationTest.CreateTableAfterClone`

Reviewers: mhaddad, zdrudi

Reviewed By: zdrudi

Subscribers: ybase

Differential Revision: https://phorge.dev.yugabyte.com/D37436
SrivastavaAnubhav added a commit that referenced this issue Aug 26, 2024
…tionTable

Summary:
Original commit: 1bb8c62 / D37436
Previously, the tablegroup manager was not updated when repartitioning a colocated table.
This was causing CREATE TABLE to add tables to the old (deleted) tablet when trying to create tables
on a cloned colocated database. This diff changes `RepartitionTable` to update the tablegroup manager
to point to the new tablet instead of the old one.
Jira: DB-12461

Test Plan: `./yb_build.sh release --cxx-test integration-tests_minicluster-snapshot-test --gtest_filter PgCloneColocationTest.CreateTableAfterClone`

Reviewers: mhaddad, zdrudi

Reviewed By: zdrudi

Subscribers: ybase

Differential Revision: https://phorge.dev.yugabyte.com/D37541
jasonyb pushed a commit that referenced this issue Aug 28, 2024
Summary:
 0c5102e [doc][yba] xCluster Replication update (#23417)
 Excluded: a9466df [#22325] YSQL, QueryDiagnostics: Adding a catalog view for queryDiagnostics
 b9597b3 [#23612] YSQL: Fix java unit test misuse of == for string comparison
 bb72624 [#23613] DocDB: Framework for different vector index coordinate types, SIFT 1B hnsw_tool support
 12032f3 [PLAT-12510] Add option to use UTC for cron expression backup schedule time calculation
 Excluded: 141703a [#22533] YSQL: fix setrefs for index scan
 1bb8c62 [#23543] docdb: Update tablegroup manager in RepartitionTable
 1e28b8a [#23518] Do not include full snapshot info for list snapshot schedules RPC.
 e98c383 [PLAT-15048] Fix auto-master failover local test
 f606132 [doc][yba] Backup clarification (#23611)
 e80d60f [PLAT-14973] Precheck for node agent install to verify that we have correct permissions to execute in the installer directory
 5230f5a [#23630]yugabyted: Modiying the APIs required for the new Migrate Schema Page.
 0a310d3 [PLAT-15042] Add default pitr retention period
 aa15c81 [PLAT-12435] Adding a precheck for libselinux bindings for system python3
 525672e [#23632] DocDB: Unify GetFlagInfos and remove duplicate code
 4ab5ca0 [#23601] YSQL: Fix TestPreparedStatements tests with connection manager enabled
 57a7690 [PLAT-12222][PLAT-15036][PLAT-14333] Add connection pooling support for create universe API
 3407682 [PLAT-10119]: Do not allow back-tick for DB password in YBA

Test Plan: Jenkins: rebase: pg15-cherrypicks

Reviewers: jason, tfoucher

Differential Revision: https://phorge.dev.yugabyte.com/D37578
@yugabyte-ci yugabyte-ci reopened this Aug 28, 2024
@yugabyte-ci yugabyte-ci added priority/highest Highest priority issue and removed priority/medium Medium priority issue status/awaiting-triage Issue awaiting triage labels Aug 28, 2024
SrivastavaAnubhav added a commit that referenced this issue Aug 30, 2024
Summary:
For each write op we apply, we check that the schema version of the table is less than or equal to the schema of the write op, but the code to get the schema version of a table was not taking into account whether the table was colocated. For colocated tables, we were just checking against the schema version of the parent table which was always 0 until DB cloning which increased it to 1 during ImportSnapshot (which caused writes with schema_version 0 to fail). This diff changes the WriteQuery code to get the appropriate schema version if the table is colocated.
Jira: DB-12461

Test Plan:
`./yb_build.sh release --cxx-test integration-tests_minicluster-snapshot-test --gtest_filter *CreateTableAfterClone*`
Jenkins: urgent

Reviewers: yyan, mhaddad

Reviewed By: yyan, mhaddad

Subscribers: ybase

Differential Revision: https://phorge.dev.yugabyte.com/D37634
SrivastavaAnubhav added a commit that referenced this issue Aug 30, 2024
…ly in WriteQuery

Summary:
Original commit: b9faf18 / D37634
For each write op we apply, we check that the schema version of the table is less than or equal to the schema of the write op, but the code to get the schema version of a table was not taking into account whether the table was colocated. For colocated tables, we were just checking against the schema version of the parent table which was always 0 until DB cloning which increased it to 1 during ImportSnapshot (which caused writes with schema_version 0 to fail). This diff changes the WriteQuery code to get the appropriate schema version if the table is colocated.
Jira: DB-12461

Test Plan:
`./yb_build.sh release --cxx-test integration-tests_minicluster-snapshot-test --gtest_filter *CreateTableAfterClone*`
Jenkins: urgent

Reviewers: yyan, mhaddad

Reviewed By: yyan

Subscribers: ybase

Differential Revision: https://phorge.dev.yugabyte.com/D37672
jasonyb pushed a commit that referenced this issue Aug 31, 2024
Summary:
 f45c6a2 Integrating budibase and YB (#23678)
 d6d60ee [doc] Enhanced PG mode (#22887)
 d0dfe63 [#23482] CDCSDK: Add an option to disable dynamic table addition while creating a stream
 51608d8 [doc] Add Python smart driver PyPI link (#23727)
 4b4c201 [#23655] YSQL: Handle SIGTERM in pg_cron
 3edf377 [PLAT] Rename YugaWare logs to Platform logs
 b9faf18 [#23543] docdb: Get colocated schema version correctly in WriteQuery
 cc43d5a [#23728] xClusterDDLRepl: Avoid colocating ddlrepl system tables
 f448fbb [PLAT-14039][YBA CLI]Refactor backup commands
 9239ede [PLAT-14813][PLAT-14812][YBA CLI] Encryption in Transit list describe and delete
 8f1c691 [PLAT-3593]Integrate collection of promdumps for prometheus metrics with support bundle
 64e9a3a [#23588] YSQL: Change calculation for finding net connections with warmup random mode in ysql connection manager
 60c5e44 [PLAT-15061] Update integration page naming

Merge:

- postgres.c:
  - quickdie: YB master 4b4c201 adds
    quickdie as SIGTERM signal handler for pg_cron.  quickdie is not
    built to expect any signal besides SIGQUIT.  Adjust the logic to
    handle SIGTERM.

Test Plan: Jenkins: rebase: pg15-cherrypicks

Reviewers: jason, tfoucher

Differential Revision: https://phorge.dev.yugabyte.com/D37684
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.23_blocker area/docdb YugabyteDB core features DB_Clone kind/bug This issue is a bug priority/highest Highest priority issue
Projects
None yet
Development

No branches or pull requests

4 participants