From 1bb7c47f8c7bfb956736d87e50bddfb8877a0f09 Mon Sep 17 00:00:00 2001 From: Diana Parra Corbacho Date: Wed, 29 May 2024 16:00:13 +0200 Subject: [PATCH] Re-introduce `gm_group` table For mixed-version clusters, as the gm table is created even if CMQ have already been deprecated --- deps/rabbit/app.bzl | 3 +++ deps/rabbit/src/gm.erl | 27 +++++++++++++++++++++++++++ deps/rabbit/src/rabbit_table.erl | 1 + 3 files changed, 31 insertions(+) create mode 100644 deps/rabbit/src/gm.erl diff --git a/deps/rabbit/app.bzl b/deps/rabbit/app.bzl index 3af7da63d3e7..9cf43bd8796a 100644 --- a/deps/rabbit/app.bzl +++ b/deps/rabbit/app.bzl @@ -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", diff --git a/deps/rabbit/src/gm.erl b/deps/rabbit/src/gm.erl new file mode 100644 index 000000000000..d2b253c98051 --- /dev/null +++ b/deps/rabbit/src/gm.erl @@ -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]}]. diff --git a/deps/rabbit/src/rabbit_table.erl b/deps/rabbit/src/rabbit_table.erl index d14cebb7c002..22b39bb30c64 100644 --- a/deps/rabbit/src/rabbit_table.erl +++ b/deps/rabbit/src/rabbit_table.erl @@ -359,6 +359,7 @@ definitions() -> mandatory_definitions() -> pre_khepri_definitions() + ++ gm:table_definitions() ++ mirrored_supervisor:table_definitions() ++ rabbit_maintenance:table_definitions().