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

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions deps/rabbit/src/rabbit_db_exchange.erl
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,12 @@ create_or_get_in_mnesia(#exchange{name = XName} = X) ->
end).

create_or_get_in_khepri(#exchange{name = XName} = X) ->
Path = khepri_exchange_path(XName),
case rabbit_khepri:create(Path, X) of
Path0 = khepri_exchange_path(XName),
Path1 = khepri_path:combine_with_conditions(
Path0, [#if_any{conditions =
[#if_node_exists{exists = false},
#if_has_payload{has_payload = false}]}]),
case rabbit_khepri:put(Path1, X) of
ok ->
{new, X};
{error, {khepri, mismatching_node, #{node_props := #{data := ExistingX}}}} ->
Expand Down
2 changes: 1 addition & 1 deletion deps/rabbit/src/rabbit_definitions.erl
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,9 @@ apply_defs(Map, ActingUser, SuccessFun) when is_function(SuccessFun) ->
concurrent_for_all(vhosts, ActingUser, Map, fun add_vhost/2),
validate_limits(Map),
concurrent_for_all(permissions, ActingUser, Map, fun add_permission/2),
concurrent_for_all(topic_permissions, ActingUser, Map, fun add_topic_permission/2),

concurrent_for_all(exchanges, ActingUser, Map, fun add_exchange/2),
concurrent_for_all(topic_permissions, ActingUser, Map, fun add_topic_permission/2),

sequential_for_all(global_parameters, ActingUser, Map, fun add_global_parameter/2),
%% importing policies concurrently can be unsafe as queues will be getting
Expand Down
Loading