Skip to content

Conversation

@mkuratczyk
Copy link
Contributor

@mkuratczyk mkuratczyk commented Oct 27, 2025

pg_local is based on the pg2 module, which got removed
from Erlang/OTP years ago. It was replaced by the more
efficient pg module, so let's use it directly.

We use node-local scopes and single-item groups so that
(de)registration is fast, but we can list all connections/channels
(by listing all groups in the scope).

@mergify mergify bot added the make label Oct 27, 2025
@mkuratczyk mkuratczyk force-pushed the remove-pg_local branch 2 times, most recently from 7998fc2 to 669513b Compare October 27, 2025 13:42
@michaelklishin michaelklishin added this to the 4.3.0 milestone Oct 27, 2025
@michaelklishin
Copy link
Collaborator

To add a bit of context here.

Process groups can be used in many ways but specifically in RabbitMQ they were used for tracking of exclusive queues on an AMQP 0-9-1 connection, so that when a connection terminates, all exclusive queues (if any) on it would be terminated very shortly after.

RabbitMQ Stream Protocol does not allow clients to declare exclusive streams, so it likely can avoid using process groups entirely. And so can most protocol readers.

mkuratczyk and others added 3 commits October 30, 2025 10:22
This function was not called from anywhere
and was the only place that expected stream
connections to be registered in pg_local.
pg_local is based on the pg2 module, which got removed
from Erlang/OTP years ago. It was replaced by the more
efficient pg module, so let's use it directly.

We use node-local scopes and single-item groups so that
(de)registration is fast, but we can list all connections/channels
(by listing all groups in the scope).
These values don't chnage at runtime and
take a surprising amount of resources when
opening a lot of connections. This speeds
up opening many connections/channels by 10%
in my tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants