Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.5:Update
rabbitmq-server.26419
bsc1199431.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bsc1199431.patch of Package rabbitmq-server.26419
From 2d6964d89e9b32a4e8ba585e0a0923a1f90f0694 Mon Sep 17 00:00:00 2001 From: Michael Klishin <michael@clojurewerkz.org> Date: Sat, 7 May 2022 21:33:09 +0400 Subject: [PATCH 1/2] Add a local replica of maintenance mode state table on boot Some users were surprised by the current approach to state table setup. Per discussion in #4755 --- deps/rabbit/src/rabbit_maintenance.erl | 36 +++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/deps/rabbit/src/rabbit_maintenance.erl b/deps/rabbit/src/rabbit_maintenance.erl index 44faff385a2..fbcc0ab2ca6 100644 --- a/deps/rabbit/src/rabbit_maintenance.erl +++ b/deps/rabbit/src/rabbit_maintenance.erl @@ -29,7 +29,8 @@ transfer_leadership_of_quorum_queues/1, transfer_leadership_of_classic_mirrored_queues/1, status_table_name/0, - status_table_definition/0 + status_table_definition/0, + boot/0 ]). -define(TABLE, rabbit_node_maintenance_states). @@ -44,6 +45,39 @@ maintenance_status/0 ]). +%% +%% Boot +%% + +-rabbit_boot_step({rabbit_maintenance_mode_state, + [{description, "initializes maintenance mode state"}, + {mfa, {?MODULE, boot, []}}, + {requires, networking}]}). + +boot() -> + case rabbit_feature_flags:is_enabled(?FEATURE_FLAG, non_blocking) of + true -> + TableName = status_table_name(), + rabbit_log:info( + "Creating table ~s for feature flag `~s`", + [TableName, ?FEATURE_FLAG]), + try + _ = rabbit_table:create( + TableName, + status_table_definition()), + _ = rabbit_table:ensure_table_copy(TableName, node()) + catch throw:Reason -> + rabbit_log:error( + "Failed to create maintenance status table: ~p", + [Reason]) + end; + false -> + ok; + state_changing -> + %% feature flag migration will do the job for us + ok + end. + %% %% API %% From a633312450e7885ad66d0aec0b07ff4a8a0d028d Mon Sep 17 00:00:00 2001 From: Michael Klishin <michael@clojurewerkz.org> Date: Sun, 8 May 2022 21:34:10 +0400 Subject: [PATCH 2/2] Maintenance mode state: don't force a local replica on boot It breaks forced node removal in some tricky scenarios because node schemas do not match, and Mnesia is sensitive to this. --- deps/rabbit/src/rabbit_maintenance.erl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/deps/rabbit/src/rabbit_maintenance.erl b/deps/rabbit/src/rabbit_maintenance.erl index fbcc0ab2ca6..09aaa7f9f70 100644 --- a/deps/rabbit/src/rabbit_maintenance.erl +++ b/deps/rabbit/src/rabbit_maintenance.erl @@ -64,8 +64,7 @@ boot() -> try _ = rabbit_table:create( TableName, - status_table_definition()), - _ = rabbit_table:ensure_table_copy(TableName, node()) + status_table_definition()) catch throw:Reason -> rabbit_log:error( "Failed to create maintenance status table: ~p",
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor