Skip to content

Conversation

edgurgel
Copy link
Member

@edgurgel edgurgel commented Oct 13, 2025

What kind of change does this PR introduce?

Selective broadcast for Postgres Changes. We use the fact that we know where each subscription subscribed from and do a direct broadcast for each node instead of spamming the whole cluster.

IF the subscription node is not readily available due to some race condition we fallback to sending to the whole cluster.

What kind of race condition?

The subscription is created like this:

  • INSERT subscription
  • Insert into the ETS table sub -> node mapping
  • Changes are polled from ReplicationPoller

With the above we use direct node broadcast

What if this happens:

  • INSERT subscription
  • Changes are polled from ReplicationPoller
  • Insert into the ETS table sub -> node mapping

The ETS table was not updated in time so the node information is not there. We use cluster broadcast.

Additional context

Add any other context or screenshots.

@edgurgel edgurgel force-pushed the feat/postgres-changes-direct-broadcast branch from 43667b7 to 640749b Compare October 13, 2025 22:36
@coveralls
Copy link

coveralls commented Oct 13, 2025

Coverage Status

Changes unknown
when pulling a5c115d on feat/postgres-changes-direct-broadcast
into ** on main**.

@edgurgel edgurgel force-pushed the feat/postgres-changes-direct-broadcast branch from c388fde to a5c115d Compare October 14, 2025 01:55
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