|
23 | 23 | is_virgin_node/0, is_virgin_node/1,
|
24 | 24 | dir/0,
|
25 | 25 | ensure_dir_exists/0,
|
26 |
| - is_init_finished/0]). |
| 26 | + is_init_finished/0, |
| 27 | + clear_init_finished/0]). |
27 | 28 |
|
28 | 29 | %% Exported to be used by various rabbit_db_* modules
|
29 | 30 | -export([
|
@@ -76,20 +77,6 @@ init() ->
|
76 | 77 | Error
|
77 | 78 | end.
|
78 | 79 |
|
79 |
| -init_finished() -> |
80 |
| - %% Used during initialisation by rabbit_logger_exchange_h.erl |
81 |
| - %% If an exchange logger is configured, it needs to declare the |
82 |
| - %% exchange. For this, it requires the metadata store to be |
83 |
| - %% initialised. The initialisation happens on a rabbit boot step, |
84 |
| - %% after the second phase of the prelaunch where the logger is |
85 |
| - %% configured. |
86 |
| - %% Using this persistent term the logger exchange can delay |
87 |
| - %% declaring the exchange until the metadata store is ready. |
88 |
| - persistent_term:put(?PT_KEY_INIT_FINISHED, true). |
89 |
| - |
90 |
| -is_init_finished() -> |
91 |
| - persistent_term:get(?PT_KEY_INIT_FINISHED, false). |
92 |
| - |
93 | 80 | pre_init(IsVirgin) ->
|
94 | 81 | Members = rabbit_db_cluster:members(),
|
95 | 82 | OtherMembers = rabbit_nodes:nodes_excl_me(Members),
|
@@ -120,6 +107,23 @@ init_using_khepri() ->
|
120 | 107 | #{domain => ?RMQLOG_DOMAIN_DB})
|
121 | 108 | end.
|
122 | 109 |
|
| 110 | +init_finished() -> |
| 111 | + %% Used during initialisation by rabbit_logger_exchange_h.erl |
| 112 | + %% If an exchange logger is configured, it needs to declare the |
| 113 | + %% exchange. For this, it requires the metadata store to be |
| 114 | + %% initialised. The initialisation happens on a rabbit boot step, |
| 115 | + %% after the second phase of the prelaunch where the logger is |
| 116 | + %% configured. |
| 117 | + %% Using this persistent term the logger exchange can delay |
| 118 | + %% declaring the exchange until the metadata store is ready. |
| 119 | + persistent_term:put(?PT_KEY_INIT_FINISHED, true). |
| 120 | + |
| 121 | +is_init_finished() -> |
| 122 | + persistent_term:get(?PT_KEY_INIT_FINISHED, false). |
| 123 | + |
| 124 | +clear_init_finished() -> |
| 125 | + persistent_term:erase(?PT_KEY_INIT_FINISHED). |
| 126 | + |
123 | 127 | -spec reset() -> Ret when
|
124 | 128 | Ret :: ok.
|
125 | 129 | %% @doc Resets the database and the node.
|
|
0 commit comments