QQ: exclude delivery_limit from policy repair comparison.

As it cannot be updated as part of a policy when it is disabled (-1)
 it needs to be excluded from comparison
This commit is contained in:
Karl Nilsson 2025-08-29 09:49:07 +01:00
parent 676698a233
commit 4d7a3fed1e
1 changed files with 6 additions and 2 deletions

View File

@ -770,7 +770,10 @@ system_recover(quorum_queues) ->
end.
maybe_apply_policies(Q, #{config := CurrentConfig}) ->
NewPolicyConfig = gather_policy_config(Q, false),
%% delivery_limit can't be updated from a policy and thus has to be
%% excluded from the comparison
NewPolicyConfig = maps:without([delivery_limit],
gather_policy_config(Q, false)),
RelevantKeys = maps:keys(NewPolicyConfig),
CurrentPolicyConfig = maps:with(RelevantKeys, CurrentConfig),
@ -778,7 +781,8 @@ maybe_apply_policies(Q, #{config := CurrentConfig}) ->
ShouldUpdate = NewPolicyConfig =/= CurrentPolicyConfig,
case ShouldUpdate of
true ->
?LOG_DEBUG("Re-applying policies to ~ts", [rabbit_misc:rs(amqqueue:get_name(Q))]),
?LOG_DEBUG("Re-applying policies for ~ts",
[rabbit_misc:rs(amqqueue:get_name(Q))]),
policy_changed(Q),
ok;
false -> ok