Skip to content

Structural comparison in pg-upgrade-test (both twin databases) - #38

Closed
jnasbyupgrade wants to merge 1 commit into
phase6-compare-and-reportfrom
phase6b-compare-in-pg-upgrade-test
Closed

Structural comparison in pg-upgrade-test (both twin databases)#38
jnasbyupgrade wants to merge 1 commit into
phase6-compare-and-reportfrom
phase6b-compare-in-pg-upgrade-test

Conversation

@jnasbyupgrade

@jnasbyupgrade jnasbyupgrade commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Extends bin/compare_fresh_vs_update with an EXISTING_DB argument so it can structurally diff an already-populated database against a fresh install, instead of only ever creating and updating its own scratch database. This lets pg-upgrade-test's twin databases (upgrade_oldest_first/upgrade_current_first, migrated by a real binary pg_upgrade) reuse the same comparison tool the test job's update leg already uses, rather than duplicating that logic.

Since EXISTING_DB was installed independently (its own call to test/helpers/create_test_schema.sql, generating its own random schema), the fresh install this script creates for the comparison discovers and reuses that same schema instead of generating a new one - both sides still need to land in the same schema for the comparison to isolate real divergence rather than a spurious schema-name difference.

pg-upgrade-test's CI job now runs this comparison against both twin databases right after run-suite confirms they're at the current version, catching a divergence class the fixed pgTAP suite doesn't: an object left subtly different (body, comment, ACL) by surviving a real catalog migration, as opposed to only an in-place ALTER EXTENSION UPDATE.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 38b3c1d6-2fdb-4b02-89ca-72a6e0464c79

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jnasbyupgrade jnasbyupgrade changed the title Phase 6b: structural comparison in pg-upgrade-test (both twin databases) Structural comparison in pg-upgrade-test (both twin databases) Aug 4, 2026
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@jnasbyupgrade
jnasbyupgrade marked this pull request as draft August 4, 2026 21:11
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6b-compare-in-pg-upgrade-test branch from 8f0a273 to e74ffc6 Compare August 4, 2026 23:17
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6-compare-and-report branch from 6146766 to c41e8f5 Compare August 5, 2026 18:14
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6b-compare-in-pg-upgrade-test branch 2 times, most recently from a545c66 to a21fd53 Compare August 5, 2026 19:40
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6-compare-and-report branch 2 times, most recently from 30073d0 to 1ff9811 Compare August 5, 2026 19:57
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6b-compare-in-pg-upgrade-test branch 2 times, most recently from e0fb0d2 to 80b0215 Compare August 5, 2026 21:45
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6-compare-and-report branch from 6277cd3 to 7ce4954 Compare August 5, 2026 22:49
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6b-compare-in-pg-upgrade-test branch from 80b0215 to 49875be Compare August 5, 2026 22:49
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6-compare-and-report branch from 7ce4954 to 73ce64e Compare August 5, 2026 23:00
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6b-compare-in-pg-upgrade-test branch from 49875be to ea5f6b5 Compare August 5, 2026 23:00
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6-compare-and-report branch from 73ce64e to 1858473 Compare August 5, 2026 23:11
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6b-compare-in-pg-upgrade-test branch 2 times, most recently from d0cb6de to d0d0dd9 Compare August 5, 2026 23:16
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6-compare-and-report branch from 1a11083 to bd14a70 Compare August 6, 2026 18:05
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6b-compare-in-pg-upgrade-test branch from d0d0dd9 to 89db338 Compare August 6, 2026 18:05
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6-compare-and-report branch from bd14a70 to 4008107 Compare August 6, 2026 18:54
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6b-compare-in-pg-upgrade-test branch from 89db338 to 45ee2d4 Compare August 6, 2026 18:54
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6-compare-and-report branch from 4008107 to 00371d9 Compare August 6, 2026 19:04
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6b-compare-in-pg-upgrade-test branch from 45ee2d4 to 93b075a Compare August 6, 2026 19:04
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6-compare-and-report branch from 00371d9 to c8bf327 Compare August 6, 2026 19:16
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6b-compare-in-pg-upgrade-test branch from 93b075a to d19c5ac Compare August 6, 2026 19:16
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6-compare-and-report branch from c8bf327 to aed095e Compare August 6, 2026 20:57
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6b-compare-in-pg-upgrade-test branch from d19c5ac to eed3319 Compare August 6, 2026 20:57
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6-compare-and-report branch from aed095e to 019e3ee Compare August 6, 2026 21:24
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6b-compare-in-pg-upgrade-test branch from eed3319 to 9dbbc9d Compare August 6, 2026 21:25
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6-compare-and-report branch from 019e3ee to 5a9fde3 Compare August 6, 2026 21:29
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6b-compare-in-pg-upgrade-test branch from 9dbbc9d to 3b09aa5 Compare August 6, 2026 21:29
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6-compare-and-report branch from 5a9fde3 to 449633a Compare August 6, 2026 22:13
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6b-compare-in-pg-upgrade-test branch from 3b09aa5 to 73f309f Compare August 6, 2026 22:14
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6-compare-and-report branch from 449633a to 0211525 Compare August 6, 2026 22:51
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6b-compare-in-pg-upgrade-test branch from 73f309f to c303d3f Compare August 6, 2026 22:51
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6-compare-and-report branch from 0211525 to ae463a2 Compare August 6, 2026 22:56
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6b-compare-in-pg-upgrade-test branch from c303d3f to 1f11c1a Compare August 6, 2026 22:56
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6-compare-and-report branch from ae463a2 to 1a833cd Compare August 9, 2026 18:50
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6b-compare-in-pg-upgrade-test branch from 1f11c1a to 7d20c0d Compare August 9, 2026 19:59
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6-compare-and-report branch from 1a833cd to ffe07ed Compare August 9, 2026 20:19
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6b-compare-in-pg-upgrade-test branch from 7d20c0d to 8e67619 Compare August 9, 2026 20:21
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6-compare-and-report branch from ffe07ed to b1bc394 Compare August 9, 2026 20:27
…de-test

Adds an EXISTING_DB argument to bin/compare_fresh_vs_update so it can
structurally diff an already-populated database against a fresh install,
instead of only ever creating+updating its own scratch database - lets
callers that produced their update/upgrade result some other way (here,
bin/test_existing's real binary pg_upgrade path) reuse the same comparison
without this script re-deriving that database itself. Since EXISTING_DB was
installed independently (its own call to test/helpers/create_test_schema.sql,
generating its own random schema name), the fresh install this script creates
for the comparison discovers and reuses THAT schema rather than generating a
new one, so both sides still land in the same schema - same requirement, and
same reasoning, as the shared-schema design bin/compare_fresh_vs_update's
scratch-vs-scratch mode already uses.

Wires this into the pg-upgrade-test CI job: after run-suite proves both twin
databases (upgrade_oldest_first, upgrade_current_first - one per
update-vs-pg_upgrade ordering) are at the current version, each is now also
structurally compared against a fresh install, catching a divergence class
the fixed pgTAP suite doesn't - an object left subtly different (body,
comment, ACL) by surviving a real binary catalog migration, as opposed to
only an in-place ALTER EXTENSION UPDATE (which the test job's own update leg
already covers with the same tool).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@jnasbyupgrade
jnasbyupgrade force-pushed the phase6b-compare-in-pg-upgrade-test branch from 8e67619 to 9a3b43d Compare August 9, 2026 20:30
@jnasbyupgrade

jnasbyupgrade commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Folded into #33 - its content (EXISTING_DB support + pg-upgrade-test wiring) now lives on phase6-compare-and-report at 0365bf9, combined with #33's own content and simplified per further review (scratch-vs-scratch mode no longer generates a schema at all).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant