fix(ds): avoid crashes when starting on Windows

This commit is contained in:
firest 2023-07-26 15:37:58 +08:00
parent 90e60acabd
commit 14b76916df
2 changed files with 10 additions and 2 deletions

View File

@ -13,12 +13,20 @@ start(_Type, _Args) ->
emqx_ds_sup:start_link(). emqx_ds_sup:start_link().
init_mnesia() -> init_mnesia() ->
%% FIXME: This is a temporary workaround to avoid crashes when starting on Windows
Storage =
case mria:rocksdb_backend_available() of
true ->
rocksdb_copies;
_ ->
disc_copies
end,
ok = mria:create_table( ok = mria:create_table(
?SESSION_TAB, ?SESSION_TAB,
[ [
{rlog_shard, ?DS_SHARD}, {rlog_shard, ?DS_SHARD},
{type, set}, {type, set},
{storage, rocksdb_copies}, {storage, Storage},
{record_name, session}, {record_name, session},
{attributes, record_info(fields, session)} {attributes, record_info(fields, session)}
] ]

View File

@ -2,7 +2,7 @@
{application, emqx_durable_storage, [ {application, emqx_durable_storage, [
{description, "Message persistence and subscription replays for EMQX"}, {description, "Message persistence and subscription replays for EMQX"},
% strict semver, bump manually! % strict semver, bump manually!
{vsn, "0.1.1"}, {vsn, "0.1.2"},
{modules, []}, {modules, []},
{registered, []}, {registered, []},
{applications, [kernel, stdlib, rocksdb, gproc, mria]}, {applications, [kernel, stdlib, rocksdb, gproc, mria]},