Skip to content

Commit

Permalink
Fix rabbit_vm:memory stream_queue_coordinator_procs always zero
Browse files Browse the repository at this point in the history
The memory of rabbit_stream_coordinator process was reported as other,
because there was a mismatch in ancestors. It is not under
`ra_server_sup_sup` any more but:
`[_,ra_coordination_server_sup_sup,_,ra_systems_sup,ra_sup,_]`

Instead of ancestors use its registered name to categorize it.

(cherry picked from commit 21e1d86)
(cherry picked from commit df852bf)
  • Loading branch information
gomoripeti authored and mergify[bot] committed Mar 14, 2023
1 parent 1ba8679 commit 37795aa
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions deps/rabbit/src/rabbit_vm.erl
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ bytes(Words) -> try
end.

interesting_sups() ->
[queue_sups(), quorum_sups(), dlx_sups(), stream_server_sups(), stream_reader_sups(),
[queue_sups(), quorum_sups(), dlx_sups(),
stream_server_sups(), stream_reader_sups(), stream_coordinator(),
conn_sups() | interesting_sups0()].

queue_sups() ->
Expand All @@ -188,6 +189,7 @@ quorum_sups() -> [ra_server_sup_sup].
dlx_sups() -> [rabbit_fifo_dlx_sup].
stream_server_sups() -> [osiris_server_sup].
stream_reader_sups() -> [osiris_replica_reader_sup].
stream_coordinator() -> [rabbit_stream_coordinator].

msg_stores() ->
all_vhosts_children(msg_store_transient)
Expand Down Expand Up @@ -234,18 +236,17 @@ ranch_server_sups() ->
with(Sups, With) -> [{Sup, With} || Sup <- Sups].

distinguishers() -> with(queue_sups(), fun queue_type/1) ++
with(conn_sups(), fun conn_type/1) ++
with(quorum_sups(), fun ra_type/1).
with(conn_sups(), fun conn_type/1).

distinguished_interesting_sups() ->
[
with(queue_sups(), master),
with(queue_sups(), slave),
with(quorum_sups(), quorum),
quorum_sups(),
dlx_sups(),
stream_server_sups(),
stream_reader_sups(),
with(quorum_sups(), stream),
stream_coordinator(),
with(conn_sups(), reader),
with(conn_sups(), writer),
with(conn_sups(), channel),
Expand Down Expand Up @@ -302,12 +303,6 @@ conn_type(PDict) ->
_ -> other
end.

ra_type(PDict) ->
case keyfind('$rabbit_vm_category', PDict) of
{value, rabbit_stream_coordinator} -> stream;
_ -> quorum
end.

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

%% NB: this code is non-rabbit specific.
Expand Down

0 comments on commit 37795aa

Please # to comment.