Skip to content

CI: run the pg_rewind TAP tests - #2249

Open
tuhaihe wants to merge 4 commits into
apache:mainfrom
tuhaihe:ci-pg-rewind
Open

tuhaihe wants to merge 4 commits into
apache:mainfrom
tuhaihe:ci-pg-rewind

Conversation

@tuhaihe

@tuhaihe tuhaihe commented Nov 5, 2026

Copy link
Copy Markdown
Member

CI does not run the TAP tests in src/bin/pg_rewind, so nobody sees when pg_rewind breaks. gprecoverseg uses pg_rewind for incremental recovery.

Add an ic-pg-rewind test job that runs them on Rocky 8, 9 and 10.

Assisted-by: Claude Code

Fixes #ISSUE_Number

What does this PR do?

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Breaking Changes

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Impact

Performance:

User-facing changes:

Dependencies:

Checklist

Additional Context

CI Skip Instructions


CI does not run the TAP tests in src/bin/pg_rewind, so nobody sees when
pg_rewind breaks.  gprecoverseg uses pg_rewind for incremental recovery.

Add an ic-pg-rewind test job that runs them on Rocky 8, 9 and 10.

Assisted-by: Claude Code
@tuhaihe

tuhaihe commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

Note: This separate PR addresses the failing test and is easy to review; once fixed, I’ll consolidate the similar tests into one.

The REL_16_9 merge removed the declaration of %params from
run_pg_rewind(), but kept the code that uses it.  So RewindTest.pm does
not compile, and each test that uses it stops at once:

  Global symbol "%params" requires explicit package name

Declare %params again.

Since PostgreSQL 15, run_pg_rewind() also copies postgresql.conf to a
temporary directory and gives the copy to pg_rewind --config-file.  In
Cloudberry, postgresql.conf includes internal.auto.conf, which sets
gp_dbid, by a relative path.  So copy internal.auto.conf next to it.

Assisted-by: Claude Code
The Cloudberry tests 101 to 106 use the TestLib module, which
PostgreSQL 16 does not have any more.  Use PostgreSQL::Test::Utils
instead.

They also have a fixed test plan, and the shared code in RewindTest.pm
now makes more checks.  For example, 101_ao_rewind.pl plans 17 tests
but runs 41.  Use done_testing(), as the upstream pg_rewind tests do.

Assisted-by: Claude Code
wait_for_catchup() finds the standby in pg_stat_replication by its
application name: the name of the node, or "walreceiver".  But in
Cloudberry, the recovery configuration that pg_basebackup -R and
pg_rewind --write-recovery-conf write sets the application name to
"gp_walreceiver".  So a test that waits for such a standby times out,
for example 007_standby_source.pl:

  timed out waiting for catchup at t/007_standby_source.pl line 162.

Also accept "gp_walreceiver".

Assisted-by: Claude Code

@leborchuk leborchuk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just fixes tests here

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.

2 participants