Skip to content

Commit bf222e1

Browse files
acogoluegnesmergify[bot]
authored andcommitted
Remove debug log statements in stream SAC coordinator
They can be useful and are not on hot paths, but they are replicated on all nodes as part of the state machine replication, so we are better off removing them to avoid noise. References #7743 (cherry picked from commit c2bfcc4) (cherry picked from commit f7043fb)
1 parent 805688c commit bf222e1

File tree

1 file changed

+1
-26
lines changed

1 file changed

+1
-26
lines changed

deps/rabbit/src/rabbit_stream_sac_coordinator.erl

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,6 @@ apply(#command_activate_consumer{vhost = VirtualHost,
269269
stream = Stream,
270270
consumer_name = ConsumerName},
271271
#?MODULE{groups = StreamGroups0} = State0) ->
272-
rabbit_log:debug("Activating consumer on ~tp, group ~p",
273-
[Stream, ConsumerName]),
274272
{G, Eff} =
275273
case lookup_group(VirtualHost, Stream, ConsumerName, StreamGroups0) of
276274
undefined ->
@@ -281,11 +279,7 @@ apply(#command_activate_consumer{vhost = VirtualHost,
281279
Group ->
282280
#consumer{pid = Pid, subscription_id = SubId} =
283281
evaluate_active_consumer(Group),
284-
rabbit_log:debug("New active consumer on ~tp, group ~tp " ++
285-
"is ~tp from ~tp",
286-
[Stream, ConsumerName, SubId, Pid]),
287-
Group1 =
288-
update_consumer_state_in_group(Group, Pid, SubId, true),
282+
Group1 = update_consumer_state_in_group(Group, Pid, SubId, true),
289283
{Group1, [notify_consumer_effect(Pid, SubId, Stream, ConsumerName, true)]}
290284
end,
291285
StreamGroups1 =
@@ -575,10 +569,6 @@ do_register_consumer(VirtualHost,
575569
%% the current active stays the same
576570
{G1, []};
577571
_ ->
578-
rabbit_log:debug("SAC consumer registration: " ++
579-
"active consumer change on stream ~tp, group ~tp. " ++
580-
"Notifying ~tp from ~tp it is no longer active.",
581-
[Stream, ConsumerName, ActSubId, ActPid]),
582572
%% there's a change, telling the active it's not longer active
583573
{update_consumer_state_in_group(G1,
584574
ActPid,
@@ -592,9 +582,6 @@ do_register_consumer(VirtualHost,
592582
true)]}
593583
end;
594584
false ->
595-
rabbit_log:debug("SAC consumer registration: no active consumer on stream ~tp, group ~tp. " ++
596-
"Likely waiting for a response from former active consumer.",
597-
[Stream, ConsumerName]),
598585
%% no active consumer in the (non-empty) group,
599586
%% we are waiting for the reply of a former active
600587
{G1, []}
@@ -640,11 +627,6 @@ handle_consumer_removal(Group0, Consumer, Stream, ConsumerName) ->
640627
%% the current active stays the same
641628
{Group0, []};
642629
_ ->
643-
rabbit_log:debug("SAC consumer removal: " ++
644-
"active consumer change on stream ~tp, group ~tp. " ++
645-
"Notifying ~tp from ~tp it is no longer active.",
646-
[Stream, ConsumerName, ActSubId, ActPid]),
647-
648630
%% there's a change, telling the active it's not longer active
649631
{update_consumer_state_in_group(Group0,
650632
ActPid,
@@ -659,17 +641,10 @@ handle_consumer_removal(Group0, Consumer, Stream, ConsumerName) ->
659641
%% the active one is going away, picking a new one
660642
#consumer{pid = P, subscription_id = SID} =
661643
evaluate_active_consumer(Group0),
662-
rabbit_log:debug("SAC consumer removal: " ++
663-
"active consumer change on stream ~tp, group ~tp. " ++
664-
"Notifying ~tp from ~tp it is the new active consumer.",
665-
[Stream, ConsumerName, SID, P]),
666644
{update_consumer_state_in_group(Group0, P, SID, true),
667645
[notify_consumer_effect(P, SID,
668646
Stream, ConsumerName, true)]};
669647
false ->
670-
rabbit_log:debug("SAC consumer removal: no active consumer on stream ~tp, group ~tp. " ++
671-
"Likely waiting for a response from former active consumer.",
672-
[Stream, ConsumerName]),
673648
%% no active consumer in the (non-empty) group,
674649
%% we are waiting for the reply of a former active
675650
{Group0, []}

0 commit comments

Comments
 (0)