From 05717ccccf34a03dec57534f922bcde4d6199ba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Tue, 12 Nov 2024 18:43:16 +0100 Subject: [PATCH] rabbit_khepri: Remove serial file during reset --- deps/rabbit/src/rabbit_khepri.erl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/deps/rabbit/src/rabbit_khepri.erl b/deps/rabbit/src/rabbit_khepri.erl index 8b570429e4a..a70ef0c676c 100644 --- a/deps/rabbit/src/rabbit_khepri.erl +++ b/deps/rabbit/src/rabbit_khepri.erl @@ -591,7 +591,10 @@ reset() -> %% Restart it. ok = setup(), ok = khepri_cluster:reset(?RA_CLUSTER_NAME), - ok = khepri:stop(?RA_CLUSTER_NAME); + ok = khepri:stop(?RA_CLUSTER_NAME), + + _ = file:delete(rabbit_guid:filename()), + ok; true -> throw({error, rabbitmq_unexpectedly_running}) end. @@ -605,7 +608,10 @@ force_reset() -> DataDir = maps:get(data_dir, ra_system:fetch(coordination)), ok = ra_system:ensure_ra_system_stopped(coordination), ok = rabbit_file:recursive_delete( - filelib:wildcard(DataDir ++ "/*")); + filelib:wildcard(DataDir ++ "/*")), + + _ = file:delete(rabbit_guid:filename()), + ok; true -> throw({error, rabbitmq_unexpectedly_running}) end.