Re-introduce `gm_group` table

For mixed-version clusters, as the gm table is created even if
CMQ have already been deprecated
This commit is contained in:
Diana Parra Corbacho 2024-05-29 16:00:13 +02:00
parent 3bbda5bdba
commit a83e80fc42
3 changed files with 31 additions and 0 deletions

3
deps/rabbit/app.bzl vendored
View File

@ -9,6 +9,7 @@ def all_beam_files(name = "all_beam_files"):
erlang_bytecode(
name = "behaviours",
srcs = [
"src/gm.erl",
"src/mc.erl",
"src/rabbit_backing_queue.erl",
"src/rabbit_credential_validator.erl",
@ -266,6 +267,7 @@ def all_test_beam_files(name = "all_test_beam_files"):
name = "test_behaviours",
testonly = True,
srcs = [
"src/gm.erl",
"src/mc.erl",
"src/rabbit_backing_queue.erl",
"src/rabbit_credential_validator.erl",
@ -561,6 +563,7 @@ def all_srcs(name = "all_srcs"):
"src/background_gc.erl",
"src/code_server_cache.erl",
"src/gatherer.erl",
"src/gm.erl",
"src/internal_user.erl",
"src/lqueue.erl",
"src/mc.erl",

27
deps/rabbit/src/gm.erl vendored Normal file
View File

@ -0,0 +1,27 @@
%% This Source Code Form is subject to the terms of the Mozilla Public
%% License, v. 2.0. If a copy of the MPL was not distributed with this
%% file, You can obtain one at https://mozilla.org/MPL/2.0/.
%%
%% Copyright (c) 2007-2024 Broadcom. All Rights Reserved. The term Broadcom refers to Broadcom Inc. and/or its subsidiaries. All rights reserved.
%%
-module(gm).
%% Deprecated with CMQ.
%% This module stays here for mixed-version compatibility, because of
%% the `gm_group` table. It can be removed once the migration to Khepri
%% is finalised and Mnesia fully removed.
-export([table_definitions/0]).
-define(GROUP_TABLE, gm_group).
-record(gm_group, { name, version, members }).
-define(TABLE, {?GROUP_TABLE, [{record_name, gm_group},
{attributes, record_info(fields, gm_group)}]}).
-define(TABLE_MATCH, {match, #gm_group { _ = '_' }}).
table_definitions() ->
{Name, Attributes} = ?TABLE,
[{Name, [?TABLE_MATCH | Attributes]}].

View File

@ -359,6 +359,7 @@ definitions() ->
mandatory_definitions() ->
pre_khepri_definitions()
++ gm:table_definitions()
++ mirrored_supervisor:table_definitions()
++ rabbit_maintenance:table_definitions().