-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#26262] DocDB: Fix load balancing for rewritten tables in a colocate…
…d database Summary: `ReadPgClassInfo` in `sys_catalog.cc` constructs a map of tables to their tablespaces. There is a check performed exclusively on colocated databases to skip over primary key indexes: ``` if (is_colocated_database) { ... auto table_info = master_->catalog_manager()->GetTableInfo(GetPgsqlTableId(database_oid, oid)); if (!table_info) { // Primary key indexes are a separate entry in pg_class but they do not have // their own entry in YugaByte's catalog manager. So, we skip them here. continue; } } ``` This check is incorrect because it uses the relation's oid instead of the relation's relfilenode to look up table info. This causes the lookup to fail for rewritten tables (in a colocated database) because the old table is dropped during the rewrite. After a master restart, the table info for the dropped table is cleared from memory, causing the rewritten table to be incorrectly skipped. This revision moves this check after the computation of the table_id, ensuring it uses the correct oid or relfilenode as necessary. Also, perform the check for all relations, as we also want to skip adding primary key indexes that are not in colocated databases. Jira: DB-15606 Test Plan: Jenkins: urgent ./yb_build.sh release --java-test 'org.yb.pgsql.TestTablespaceProperties#testTableRewrite' Reviewers: asrivastava, slingam, smishra, hsunder, kfranz Reviewed By: hsunder, kfranz Subscribers: kfranz, ybase Differential Revision: https://phorge.dev.yugabyte.com/D42236
- Loading branch information
1 parent
ca4c58b
commit 2c4972f
Showing
4 changed files
with
81 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters