Skip to content

[DPE-7882] fix(logical-replication): block cyclic subscription requests (4/5) - #269

Draft
marceloneppel wants to merge 1 commit into
lr-3-circular-chainsfrom
lr-4-circular-validation
Draft

[DPE-7882] fix(logical-replication): block cyclic subscription requests (4/5)#269
marceloneppel wants to merge 1 commit into
lr-3-circular-chainsfrom
lr-4-circular-validation

Conversation

@marceloneppel

Copy link
Copy Markdown
Member

Issue

Fourth PR of the logical replication migration series (after #268). Completes the fix for canonical/postgresql-operator#1085: configuring the same table on both sides of the relation previously set up cyclic replication and an infinite loop of inserts; it must instead fail validation with a blocked status.

Solution

Subscriber-side rejection of its own circular setups, before the request reaches the publisher:

  • subscribing to a table this app already publishes to the same remote app fails validation (_check_subscriber_circular_replication),
  • subscribing to a table whose remote replication chain already contains this app fails validation (_would_create_circular_replication, multi-hop safe),
  • both surface Circular replication detected ... blocked statuses via _fail_validation(status_msg=...).

Publisher errors reported on the relation are re-validated against the current subscription request, so stale errors no longer block relation processing, and genuine circular rejections keep the specific status message.

Checklist

  • I have added or updated any relevant documentation.
  • I have cleaned any remaining cloud resources from my accounts.

…ts (4/5)

The subscriber side now rejects its own circular setups before the
request reaches the publisher: subscribing to a table this app
already publishes to the same remote, and subscribing to a table
whose remote replication chain already contains this app, both fail
validation with a dedicated blocked status.

Publisher errors reported on the relation are re-validated against
the current subscription request, so stale errors no longer block
the relation processing, and genuine circular rejections surface the
specific status message.

Fixes canonical/postgresql-operator#1085
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