Skip to content

Commit

Permalink
Re-introduce gm_group table
Browse files Browse the repository at this point in the history
For mixed-version clusters, as the gm table is created even if
CMQ have already been deprecated
  • Loading branch information
dcorbacho committed Jun 3, 2024
1 parent 0d1cad5 commit 2c40f6a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions deps/rabbit/app.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -561,6 +562,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",
Expand Down
27 changes: 27 additions & 0 deletions deps/rabbit/src/gm.erl
Original file line number Diff line number Diff line change
@@ -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]}].
1 change: 1 addition & 0 deletions deps/rabbit/src/rabbit_table.erl
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ definitions() ->

mandatory_definitions() ->
pre_khepri_definitions()
++ gm:table_definitions()
++ mirrored_supervisor:table_definitions()
++ rabbit_maintenance:table_definitions().

Expand Down

0 comments on commit 2c40f6a

Please sign in to comment.