Switch from pg_local to pg#14825
Draft
mkuratczyk wants to merge 6 commits intomainfrom
Draft
Conversation
7998fc2 to
669513b
Compare
669513b to
c4bba00
Compare
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. |
4292012 to
b88adbb
Compare
acogoluegnes
added a commit
to rabbitmq/rabbitmq-stream-java-client
that referenced
this pull request
Nov 4, 2025
And no longer a function available in the stream plugin. References rabbitmq/rabbitmq-server#14825
a04acbe to
d80fe0e
Compare
9480a9f to
cf1d779
Compare
336a003 to
54e87d7
Compare
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 use it directly for AMQP 0-9-1 channels, TCP and non-AMQP connection tracking, and related tests. We use node-local scopes and single-item groups so that (de)registration is fast, but we can list all connections and channels by listing all groups in the scope. rabbit_direct still uses pg_local for one more commit; the next commit moves it to a local ETS table because pg cannot represent those peers in all deployment topologies (see that commit message).
pg only allows registering processes that are node local. Direct connections pass the client pid, which can be remote. Therefore, here we switch from pg_local to ETS, instead of pg.
The metadata can take a few milliseconds to reflect a node is down, so the test code must consider a connection failure and test another node.
54e87d7 to
5490d92
Compare
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.
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).