Support cross-version overview in stream SAC coordinator

When the state comes from V4 and the current module is V5.

References #14106
This commit is contained in:
Arnaud Cogoluègnes 2025-06-23 17:28:36 +02:00
parent 0ca128b80f
commit 4e7e0f0f1d
No known key found for this signature in database
GPG Key ID: D5C8C4DFAD43AFA8
1 changed files with 4 additions and 2 deletions

View File

@ -207,7 +207,7 @@ group_consumers(VirtualHost, Stream, Reference, InfoKeys) ->
-spec overview(state() | undefined) -> map() | undefined.
overview(undefined) ->
undefined;
overview(#?MODULE{groups = Groups}) ->
overview(#?MODULE{groups = Groups} = S) when ?IS_STATE_REC(S) ->
GroupsOverview =
maps:map(fun(_,
#group{consumers = Consumers, partition_index = Idx}) ->
@ -215,7 +215,9 @@ overview(#?MODULE{groups = Groups}) ->
partition_index => Idx}
end,
Groups),
#{num_groups => map_size(Groups), groups => GroupsOverview}.
#{num_groups => map_size(Groups), groups => GroupsOverview};
overview(S) ->
rabbit_stream_sac_coordinator_v4:overview(S).
-spec init_state() -> state().
init_state() ->