Skip to content

Commit 77cec49

Browse files
committed
Rename
1 parent 2d2c70c commit 77cec49

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

deps/rabbit/priv/schema/rabbit.schema

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1652,7 +1652,7 @@ end}.
16521652
%% and refuse to start if the marker exists but tables are empty.
16531653
%%
16541654

1655-
{mapping, "verify_initial_run", "rabbit.verify_initial_run", [
1655+
{mapping, "prevent_startup_if_node_was_reset", "rabbit.prevent_startup_if_node_was_reset", [
16561656
{datatype, {enum, [true, false]}}
16571657
]}.
16581658

deps/rabbit/src/rabbit.erl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
%% Boot steps.
4141
-export([update_cluster_tags/0, maybe_insert_default_data/0, boot_delegate/0, recover/0,
4242
pg_local_amqp_session/0,
43-
pg_local_amqp_connection/0, check_initial_run/0]).
43+
pg_local_amqp_connection/0, prevent_startup_if_node_was_reset/0]).
4444

4545
-rabbit_boot_step({pre_boot, [{description, "rabbit boot start"}]}).
4646

@@ -201,7 +201,7 @@
201201

202202
-rabbit_boot_step({initial_run_check,
203203
[{description, "check if this is the first time the node starts"},
204-
{mfa, {?MODULE, check_initial_run, []}},
204+
{mfa, {?MODULE, prevent_startup_if_node_was_reset, []}},
205205
{requires, recovery},
206206
{enables, empty_db_check}]}).
207207

@@ -1159,13 +1159,13 @@ update_cluster_tags() ->
11591159
rabbit_runtime_parameters:set_global(cluster_tags, Tags, <<"internal_user">>).
11601160

11611161

1162-
-spec check_initial_run() -> 'ok' | no_return().
1162+
-spec prevent_startup_if_node_was_reset() -> 'ok' | no_return().
11631163

1164-
check_initial_run() ->
1165-
case application:get_env(rabbit, verify_initial_run, false) of
1164+
prevent_startup_if_node_was_reset() ->
1165+
case application:get_env(rabbit, prevent_startup_if_node_was_reset, false) of
11661166
false ->
11671167
%% Feature is disabled, skip the check
1168-
?LOG_DEBUG("Initial run verification is disabled",
1168+
?LOG_DEBUG("prevent_startup_if_node_was_reset is disabled",
11691169
#{domain => ?RMQLOG_DOMAIN_GLOBAL}),
11701170
ok;
11711171
true ->

deps/rabbit/test/node_initial_run_SUITE.erl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
%% Copyright (c) 2007-2024 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. All rights reserved.
66
%%
77

8-
%% Test suite for the verify_initial_run feature.
8+
%% Test suite for the prevent_startup_if_node_was_reset feature.
99
%% This feature helps detect potential data loss scenarios by maintaining
1010
%% a marker file to track if a node has been initialized before.
1111

@@ -25,12 +25,12 @@ all() ->
2525
groups() ->
2626
[
2727
{single_node_mnesia, [], [
28-
verify_initial_run_disabled,
29-
verify_initial_run_enabled
28+
prevent_startup_if_node_was_reset_disabled,
29+
prevent_startup_if_node_was_reset_enabled
3030
]},
3131
{single_node_khepri, [], [
32-
verify_initial_run_disabled,
33-
verify_initial_run_enabled
32+
prevent_startup_if_node_was_reset_disabled,
33+
prevent_startup_if_node_was_reset_enabled
3434
]}
3535
].
3636

@@ -76,7 +76,7 @@ end_per_testcase(Testcase, Config) ->
7676
%% Test cases
7777
%% -------------------------------------------------------------------
7878

79-
verify_initial_run_disabled(Config) ->
79+
prevent_startup_if_node_was_reset_disabled(Config) ->
8080
% When feature is disabled (default), node should start normally
8181
DataDir = rabbit_ct_broker_helpers:get_node_config(Config, 0, data_dir),
8282
MarkerFile = filename:join(DataDir, "node_initialized.marker"),
@@ -91,7 +91,7 @@ verify_initial_run_disabled(Config) ->
9191
?assertNot(filelib:is_file(MarkerFile)),
9292
ok.
9393

94-
verify_initial_run_enabled(Config) ->
94+
prevent_startup_if_node_was_reset_enabled(Config) ->
9595
DataDir = rabbit_ct_broker_helpers:get_node_config(Config, 0, data_dir),
9696
MarkerFile = filename:join(DataDir, "node_initialized.marker"),
9797

@@ -140,11 +140,11 @@ start_app(Config) ->
140140
Error -> Error
141141
end.
142142

143-
maybe_enable_verify_initial_run(Config, verify_initial_run_enabled) ->
143+
maybe_enable_prevent_startup_if_node_was_reset(Config, prevent_startup_if_node_was_reset_enabled) ->
144144
rabbit_ct_helpers:merge_app_env(
145-
Config, {rabbit, [{verify_initial_run, true}]}
145+
Config, {rabbit, [{prevent_startup_if_node_was_reset, true}]}
146146
);
147-
maybe_enable_verify_initial_run(Config, _) ->
147+
maybe_enable_prevent_startup_if_node_was_reset(Config, _) ->
148148
Config.
149149

150150
meta_store(single_node_mnesia) ->
@@ -165,4 +165,4 @@ schema_file(Config) ->
165165

166166
set_env(Config, Bool) ->
167167
Node = rabbit_ct_broker_helpers:get_node_config(Config, 0, nodename),
168-
ok = rpc:call(Node, application, set_env, [rabbit, verify_initial_run, Bool]).
168+
ok = rpc:call(Node, application, set_env, [rabbit, prevent_startup_if_node_was_reset, Bool]).

0 commit comments

Comments
 (0)