fix(ds): Abort application startup when rocksdb is not avialable

This commit is contained in:
ieQu1 2023-11-21 18:53:34 +01:00
parent 3d823beb11
commit 3165b4f645
2 changed files with 8 additions and 7 deletions

View File

@ -440,12 +440,6 @@ del_subscription(TopicFilter, DSSessionId) ->
%%--------------------------------------------------------------------
create_tables() ->
ok = emqx_ds:open_db(?PERSISTENT_MESSAGE_DB, #{
backend => builtin,
storage => {emqx_ds_storage_bitfield_lts, #{}},
n_shards => 16,
replication_factor => 3
}),
ok = mria:create_table(
?SESSION_TAB,
[

View File

@ -29,8 +29,15 @@ start_link() ->
%% behaviour callbacks
%%================================================================================
-dialyzer({nowarn_function, init/1}).
init([]) ->
Children = [meta(), storage_layer_sup()],
%% TODO: technically, we don't need rocksDB for the alternative
%% backends. But right now we have any:
Children =
case mria:rocksdb_backend_available() of
true -> [meta(), storage_layer_sup()];
false -> []
end,
SupFlags = #{
strategy => one_for_all,
intensity => 0,