Repository navigation
Fix CDC endpos on an idle source, retry COPY on source loss, move to Debian 12 - #60
Merged
Merged
Conversation
Treat 57P01, 57P02 and 57P03 as connection errors, and reset both the source and target connections between COPY attempts. When the source is the snapshot connection, re-open the snapshot as well. Skip the COMMIT at snapshot close when the connection is already gone. Adds the copy-source-reconnect test suite.
The feedback-timer guard tested cur_record_lsn, which is declared inside the streaming loop and reset to InvalidXLogRecPtr on every iteration, so the test never passed. Test the position already streamed instead. Without this, setting the sentinel endpos on a source with no further WAL activity never stops the stream. A replica source cannot be nudged with a write, so the follow process runs forever.
Run them on pushes and same-repo pull requests only. Also register the copy-source-reconnect suite in the tiered test matrix.
Debian 11 is on LTS and its security archive no longer serves the package versions its index advertises, so apt-get install fails with a 404 on the pgcopydb image. This broke the eight test suites that build a Dockerfile.inject on that image. tests/Dockerfile.pagila already uses bookworm. Also pass PGCOPYDB_IMAGE to the exclude-extension test service, which hardcoded pgcopydb:pg16 and so failed the PG17 and PG18 matrix cells.
robdaly93
approved these changes
Sep 14, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four independent fixes found while running a live migration from a read replica.
Stop CDC when the endpos is set on an idle source. The feedback-timer guard in
pgsql_stream_logicaltestedcur_record_lsn, which is declared inside the streaming loop and reset toInvalidXLogRecPtron every iteration, so the test never passed. It now tests the position already streamed. Without this, setting the sentinel endpos on a source with no further WAL activity never stops the stream, and a replica source cannot be nudged with a write.Retry table COPY after a source connection failure. Treats 57P01, 57P02 and 57P03 as connection errors and resets both connections between attempts, re-opening the snapshot when the source is the snapshot connection. Adds the
copy-source-reconnectsuite.Skip smoke tests on fork pull requests. Runs them on pushes and same-repo pull requests only.
Move the base image to Debian 12. Debian 11 is on LTS and its security archive no longer serves the package versions its index advertises, so
apt-get installfails with a 404 on the pgcopydb image. This broke the eight suites that build aDockerfile.injecton that image.tests/Dockerfile.pagilawas already on bookworm. This changes the published image. The same commit passesPGCOPYDB_IMAGEto theexclude-extensiontest service, which hardcodedpgcopydb:pg16and so failed the PG17 and PG18 cells.Tests
Full suite green at
PGVERSION=18, all 34 suites.citus_indent --checkpasses.The run needs Docker network pruning partway through: the default address pool holds about 30 networks and the suites leave one behind each, which is a local limit, not a CI one.
Known gap, not addressed here
About eleven suites build their source database from a
Dockerfile.pgwhoseARG PGVERSION=16default is never overridden, because theircompose.yamlpasses no build args. The target follows the matrix, the source does not, so the PG18 cell ofcdc-wal2jsonruns a PG16 source into a PG18 target. Pre-existing, and left alone because fixing it may surface real PG18 failures that deserve their own triage.