Skip to content

[Fix][E2E] Wait for Postgres CDC WAL stream readiness - #11202

Merged
davidzollo merged 5 commits into
apache:devfrom
DanielLeens:dev-postgres-cdc-slot-isolation-20260628
Jun 30, 2026
Merged

[Fix][E2E] Wait for Postgres CDC WAL stream readiness#11202
davidzollo merged 5 commits into
apache:devfrom
DanielLeens:dev-postgres-cdc-slot-isolation-20260628

Conversation

@DanielLeens

@DanielLeens DanielLeens commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

This fixes a shared Postgres CDC E2E instability that is unrelated to JDBC catalog compatibility changes in #11169.

Why was CI still failing?

The original shared-fix direction was only part of the picture. The current CI failure comes from the Debezium JSON Kafka test starting DML as soon as the snapshot row becomes visible, while the WAL stream is still attaching. In that window, intermediate row-level changes can be skipped, which is why CI only observed 3 messages instead of the expected 5.

The reused Postgres test container can also retain generated replication slots between CDC jobs, so the branch keeps the slot isolation and cleanup changes as well.

How was this fixed?

  • assign a unique slot.name for each PostgresCDCIT job invocation
  • clean up stale generated replication slots between test methods
  • wait until the generated replication slot becomes active before issuing the Debezium JSON test DML
  • keep using the same generated slot across restore flows in the same test

Verification

  • ./mvnw -pl seatunnel-e2e/seatunnel-connector-v2-e2e/connector-cdc-postgres-e2e -nsu -Dmaven.gitcommitid.skip=true spotless:apply
  • ./mvnw -pl seatunnel-e2e/seatunnel-connector-v2-e2e/connector-cdc-postgres-e2e -nsu -Dmaven.gitcommitid.skip=true -DskipUT=true -DskipIT=false -Dit.test=PostgresCDCIT -DfailIfNoTests=false -Dskip.spotless=true verify

The local Maven verification reached the real E2E startup path, compiled the updated test, and then stopped on a local external-environment blocker while Testcontainers tried to pull debezium/postgres:11 from Docker Hub: toomanyrequests: You have reached your unauthenticated pull rate limit. This blocked local container startup before the code path under test could finish, so the final behavior check still relies on GitHub CI.

@github-actions github-actions Bot added the e2e label Jun 28, 2026
@davidzollo davidzollo changed the title [Fix][E2E] Isolate Postgres CDC replication slots per test run [Fix][E2E] Wait for Postgres CDC WAL stream readiness Jun 29, 2026

@nzw921rx nzw921rx left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

+1 LGTM

* an isolated slot to avoid cross-test collisions when streaming jobs overlap.
*/
private String createSlotName() {
return "seatunnel_" + Long.toHexString(JobIdGenerator.newJobId());

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

use GENERATED_SLOT_PREFIX

@davidzollo davidzollo 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

@davidzollo
davidzollo merged commit e880195 into apache:dev Jun 30, 2026
2 of 3 checks passed
junjunclub pushed a commit to junjunclub/seatunnel that referenced this pull request Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants