@@ -215,19 +215,19 @@ setup_steps() ->
215
215
fun rabbit_ct_helpers :ensure_rabbitmqctl_app /1 ,
216
216
fun rabbit_ct_helpers :ensure_rabbitmq_plugins_cmd /1 ,
217
217
fun set_lager_flood_limit /1 ,
218
+ fun configure_metadata_store /1 ,
218
219
fun start_rabbitmq_nodes /1 ,
219
- fun share_dist_and_proxy_ports_map /1 ,
220
- fun configure_metadata_store /1
220
+ fun share_dist_and_proxy_ports_map /1
221
221
];
222
222
_ ->
223
223
[
224
224
fun rabbit_ct_helpers :ensure_rabbitmqctl_cmd /1 ,
225
225
fun rabbit_ct_helpers :load_rabbitmqctl_app /1 ,
226
226
fun rabbit_ct_helpers :ensure_rabbitmq_plugins_cmd /1 ,
227
227
fun set_lager_flood_limit /1 ,
228
+ fun configure_metadata_store /1 ,
228
229
fun start_rabbitmq_nodes /1 ,
229
- fun share_dist_and_proxy_ports_map /1 ,
230
- fun configure_metadata_store /1
230
+ fun share_dist_and_proxy_ports_map /1
231
231
]
232
232
end .
233
233
@@ -999,57 +999,61 @@ share_dist_and_proxy_ports_map(Config) ->
999
999
configured_metadata_store (Config ) ->
1000
1000
case rabbit_ct_helpers :get_config (Config , metadata_store ) of
1001
1001
khepri ->
1002
- {khepri , []};
1003
- {khepri , _FFs0 } = Khepri ->
1004
- Khepri ;
1002
+ khepri ;
1005
1003
mnesia ->
1006
1004
mnesia ;
1007
1005
_ ->
1008
1006
case os :getenv (" RABBITMQ_METADATA_STORE" ) of
1009
- " khepri" ->
1010
- {khepri , []};
1011
- _ ->
1012
- mnesia
1007
+ " khepri" -> khepri ;
1008
+ _ -> mnesia
1013
1009
end
1014
1010
end .
1015
1011
1016
1012
configure_metadata_store (Config ) ->
1017
1013
ct :log (" Configuring metadata store..." ),
1014
+ Value = rabbit_ct_helpers :get_app_env (
1015
+ Config , rabbit , forced_feature_flags_on_init , undefined ),
1018
1016
case configured_metadata_store (Config ) of
1019
- {khepri , FFs0 } ->
1020
- case enable_khepri_metadata_store (Config , FFs0 ) of
1021
- {skip , _ } = Skip ->
1022
- _ = stop_rabbitmq_nodes (Config ),
1023
- Skip ;
1024
- Config1 ->
1025
- Config1
1017
+ khepri ->
1018
+ ct :log (" Enabling Khepri metadata store" ),
1019
+ case Value of
1020
+ undefined ->
1021
+ rabbit_ct_helpers :merge_app_env (
1022
+ Config ,
1023
+ {rabbit ,
1024
+ [{forced_feature_flags_on_init ,
1025
+ {rel , [khepri_db ], []}}]});
1026
+ _ ->
1027
+ rabbit_ct_helpers :merge_app_env (
1028
+ Config ,
1029
+ {rabbit ,
1030
+ [{forced_feature_flags_on_init ,
1031
+ [khepri_db | Value ]}]})
1026
1032
end ;
1027
1033
mnesia ->
1028
1034
ct :log (" Enabling Mnesia metadata store" ),
1029
- Config
1035
+ case Value of
1036
+ undefined ->
1037
+ rabbit_ct_helpers :merge_app_env (
1038
+ Config ,
1039
+ {rabbit ,
1040
+ [{forced_feature_flags_on_init ,
1041
+ {rel , [], [khepri_db ]}}]});
1042
+ _ ->
1043
+ rabbit_ct_helpers :merge_app_env (
1044
+ Config ,
1045
+ {rabbit ,
1046
+ [{forced_feature_flags_on_init ,
1047
+ Value -- [khepri_db ]}]})
1048
+ end
1030
1049
end .
1031
1050
1032
- enable_khepri_metadata_store (Config , FFs0 ) ->
1033
- ct :log (" Enabling Khepri metadata store" ),
1034
- FFs = [khepri_db | FFs0 ],
1035
- lists :foldl (fun (_FF , {skip , _Reason } = Skip ) ->
1036
- Skip ;
1037
- (FF , C ) ->
1038
- case enable_feature_flag (C , FF ) of
1039
- ok ->
1040
- C ;
1041
- {skip , _ } = Skip ->
1042
- ct :pal (" Enabling metadata store failed: ~p " , [Skip ]),
1043
- Skip
1044
- end
1045
- end , Config , FFs ).
1046
-
1047
1051
% % Waits until the metadata store replica on Node is up to date with the leader.
1048
1052
await_metadata_store_consistent (Config , Node ) ->
1049
1053
case configured_metadata_store (Config ) of
1050
1054
mnesia ->
1051
1055
ok ;
1052
- { khepri , _ } ->
1056
+ khepri ->
1053
1057
RaClusterName = rabbit_khepri :get_ra_cluster_name (),
1054
1058
Leader = rpc (Config , Node , ra_leaderboard , lookup_leader , [RaClusterName ]),
1055
1059
LastAppliedLeader = ra_last_applied (Leader ),
0 commit comments