-
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.
[BACKPORT pg15-cherrypicks][#23304] fix Postgres so old dumps can be …
…loaded that do not have pg_class OIDs Summary: Original commit: 16941de / D37360 Modifications due to standard conflicts that auto resolve could not resolve: - heap.c - function heap_create_with_catalog - master commit 16941de changes the logic for when to require pg_class heap OIDs (they are now only required when yb_ignore_heap_pg_class_oids is false when in yb_binary_restore mode) - PG cherry picks trunk via merge of master commit 516ead0 with upstream Postgres 37b2764593c073ca61c2baebd7d85666e553928b refactors how RELKIND are handled - resolution: apply the just the intended logic change to the upstream Postgres code Rest of original diff summary: The previous diff of this stack, https://phorge.dev.yugabyte.com/D36675, changed ysql_dump/Postgres so it emits information about the pg_class OIDs of objects and at restore time verifies that every object that need such an OID has one provided. Unfortunately, this breaks backward compatibility: if we attempt to restore a dump made before that diff, it fails because those dumps don't have information about every object that needs such OID. This diff fixes this by making the check only applied if a new GUC, yb_ignore_heap_pg_class_oids, is turned on. The new dump sets this variable in its output but it would obviously not be set in the old dump output. This let's us restore old backups without problem but would turn off the check for some cases we don't use (e.g., trying to restore output of pg_dump with binary upgrade set). Test Plan: Verify preserving all pg_class OIDs works for new version: ``` ybd --cxx-test yb-backup-cross-feature-test --gtest_filter '*.TestPreservingPgEnumOids' --test-args '--verbose_yb_backup' >& /tmp/generic.mdl.log ybd --cxx-test yb-backup-cross-feature-test --gtest_filter '*.TestPreservingPgTypeAndClassOids' --test-args '--verbose_yb_backup' >& /tmp/generic.mdl.log ``` Other tests: ``` ybd --java-test 'org.yb.pgsql.TestYsqlDump#ysqlDumpAllWithYbMetadata' >& /tmp/generic.mdl.log ybd --java-test 'org.yb.pgsql.TestYsqlDump#ysqlDumpWithYbMetadata' >& /tmp/generic.mdl.log2 ybd --java-test 'org.yb.pgsql.TestYsqlDump#ysqlDumpColocatedDB' >& /tmp/generic.mdl.log3 ybd --java-test 'org.yb.pgsql.TestYsqlDump#ysqlDumpLegacyColocatedDB' >& /tmp/generic.mdl.log4 ybd --java-test 'org.yb.pgsql.TestYsqlDump#ysqlDumpWithoutYbMetadata' >& /tmp/generic.mdl.log5 ``` I did not verify that backwards compatibility was maintained -- being able to import a PG 11 dump into PG 15 will likely require more than just this diff. Reviewers: jason, tfoucher Reviewed By: jason Differential Revision: https://phorge.dev.yugabyte.com/D37810
Showing
10 changed files
with
41 additions
and
1 deletion.
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
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
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