Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deps/rabbit/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ PARALLEL_CT_SET_3_B = list_consumers_sanity_check list_queues_online_and_offline
PARALLEL_CT_SET_3_C = cli_forget_cluster_node mc_unit message_size_limit
PARALLEL_CT_SET_3_D = metadata_store_phase1 metrics mirrored_supervisor peer_discovery_classic_config proxy_protocol runtime_parameters unit_rabbit_vm unit_stats_and_metrics unit_supervisor2 unit_vm_memory_monitor

PARALLEL_CT_SET_4_A = clustering_events rabbit_local_random_exchange rabbit_msg_interceptor rabbitmq_4_0_deprecations unit_pg_local unit_plugin_directories unit_plugin_versioning unit_policy_validators unit_priority_queue
PARALLEL_CT_SET_4_A = clustering_events rabbit_local_random_exchange rabbit_msg_interceptor rabbitmq_4_0_deprecations unit_plugin_directories unit_plugin_versioning unit_policy_validators unit_priority_queue
PARALLEL_CT_SET_4_B = per_user_connection_tracking per_vhost_connection_limit rabbit_fifo_int unit_default_queue_type
PARALLEL_CT_SET_4_C = msg_size_metrics unit_msg_size_metrics per_vhost_msg_store per_vhost_queue_limit priority_queue upgrade_preparation vhost
PARALLEL_CT_SET_4_D = per_user_connection_channel_tracking product_info queue_type rabbitmq_queues_cli_integration rabbitmq_streams_cli_integration rabbitmqctl_integration rabbitmqctl_shutdown routing rabbit_amqqueue
Expand Down
251 changes: 0 additions & 251 deletions deps/rabbit/src/pg_local.erl

This file was deleted.

55 changes: 52 additions & 3 deletions deps/rabbit/src/rabbit.erl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
base_product_version/0,
motd_file/0,
motd/0,
pg_local_scope/1]).
pg_local_scope/1,
pg_scope_amqp091_channel/0,
pg_scope_amqp091_connection/0,
pg_scope_non_amqp_connection/0]).
%% For CLI, testing and mgmt-agent.
-export([set_log_level/1, log_locations/0, config_files/0]).
-export([is_booted/1, is_booted/0, is_booting/1, is_booting/0]).
Expand All @@ -39,7 +42,11 @@
%% Boot steps.
-export([update_cluster_tags/0, maybe_insert_default_data/0, boot_delegate/0, recover/0,
pg_local_amqp_session/0,
pg_local_amqp_connection/0, prevent_startup_if_node_was_reset/0]).
pg_local_amqp_connection/0,
pg_local_amqp091_channel/0,
pg_local_amqp091_connection/0,
pg_local_non_amqp_connection/0,
prevent_startup_if_node_was_reset/0]).

-rabbit_boot_step({pre_boot, [{description, "rabbit boot start"}]}).

Expand Down Expand Up @@ -282,11 +289,29 @@
{enables, core_initialized}]}).

-rabbit_boot_step({pg_local_amqp_connection,
[{description, "local-only pg scope for AMQP connections"},
[{description, "local-only pg scope for AMQP 1.0 connections"},
{mfa, {rabbit, pg_local_amqp_connection, []}},
{requires, kernel_ready},
{enables, core_initialized}]}).

-rabbit_boot_step({pg_local_amqp091_channel,
[{description, "local-only pg scope for AMQP 0-9-1 channels"},
{mfa, {rabbit, pg_local_amqp091_channel, []}},
{requires, kernel_ready},
{enables, core_initialized}]}).

-rabbit_boot_step({pg_local_amqp091_connection,
[{description, "local-only pg scope for AMQP 0-9-1 connections"},
{mfa, {rabbit, pg_local_amqp091_connection, []}},
{requires, kernel_ready},
{enables, core_initialized}]}).

-rabbit_boot_step({pg_local_non_amqp_connection,
[{description, "local-only pg scope for non-AMQP connections"},
{mfa, {rabbit, pg_local_non_amqp_connection, []}},
{requires, kernel_ready},
{enables, core_initialized}]}).

%%---------------------------------------------------------------------------

-include_lib("rabbit_common/include/rabbit.hrl").
Expand Down Expand Up @@ -1142,9 +1167,33 @@ pg_local_amqp_connection() ->
PgScope = pg_local_scope(amqp_connection),
rabbit_sup:start_child(pg_amqp_connection, pg, [PgScope]).

pg_local_amqp091_channel() ->
PgScope = pg_local_scope(amqp091_channel),
persistent_term:put(pg_scope_amqp091_channel, PgScope),
rabbit_sup:start_child(pg_amqp091_channel, pg, [PgScope]).

pg_local_amqp091_connection() ->
PgScope = pg_local_scope(amqp091_connection),
persistent_term:put(pg_scope_amqp091_connection, PgScope),
rabbit_sup:start_child(pg_amqp091_connection, pg, [PgScope]).

pg_local_non_amqp_connection() ->
PgScope = pg_local_scope(non_amqp_connection),
persistent_term:put(pg_scope_non_amqp_connection, PgScope),
rabbit_sup:start_child(pg_non_amqp_connection, pg, [PgScope]).

pg_local_scope(Prefix) ->
list_to_atom(io_lib:format("~s_~s", [Prefix, node()])).

pg_scope_amqp091_channel() ->
persistent_term:get(pg_scope_amqp091_channel).

pg_scope_amqp091_connection() ->
persistent_term:get(pg_scope_amqp091_connection).

pg_scope_non_amqp_connection() ->
persistent_term:get(pg_scope_non_amqp_connection).

-spec update_cluster_tags() -> 'ok'.

update_cluster_tags() ->
Expand Down
Loading
Loading