Merge pull request #13533 from rabbitmq/remove-setup-retries-in-rabbit_khepri

Khepri: Remove setup retries
This commit is contained in:
Jean-Sébastien Pédron 2025-03-18 14:29:32 +01:00 committed by GitHub
commit 14d53f83cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 19 deletions

View File

@ -288,12 +288,6 @@ retry_timeout() ->
undefined -> 300_000 undefined -> 300_000
end. end.
retry_limit() ->
case application:get_env(rabbit, khepri_leader_wait_retry_limit) of
{ok, T} -> T;
undefined -> 10
end.
%% @private %% @private
-spec init(IsVirgin) -> Ret when -spec init(IsVirgin) -> Ret when
@ -333,22 +327,13 @@ init(IsVirgin) ->
end. end.
await_replication() -> await_replication() ->
await_replication(retry_timeout(), retry_limit()). Timeout = retry_timeout(),
await_replication(_Timeout, 0) ->
{error, timeout};
await_replication(Timeout, Retries) ->
?LOG_DEBUG( ?LOG_DEBUG(
"Khepri-based " ?RA_FRIENDLY_NAME " waiting to catch up on replication " "Khepri-based " ?RA_FRIENDLY_NAME " waiting to catch up on replication "
"to the Raft cluster leader. Waiting for ~tb ms, ~tb retries left", "to the Raft cluster leader. Waiting for ~tb ms",
[Timeout, Retries], [Timeout],
#{domain => ?RMQLOG_DOMAIN_DB}), #{domain => ?RMQLOG_DOMAIN_DB}),
case fence(Timeout) of fence(Timeout).
ok ->
ok;
{error, timeout} ->
await_replication(Timeout, Retries -1)
end.
%% @private %% @private