Skip to content

Commit

Permalink
fix(ds): avoid crashes when starting on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
lafirest committed Jul 26, 2023
1 parent 90e60ac commit 14b7691
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion apps/emqx_durable_storage/src/emqx_ds_app.erl
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,20 @@ start(_Type, _Args) ->
emqx_ds_sup:start_link().

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(
?SESSION_TAB,
[
{rlog_shard, ?DS_SHARD},
{type, set},
{storage, rocksdb_copies},
{storage, Storage},
{record_name, session},
{attributes, record_info(fields, session)}
]
Expand Down
2 changes: 1 addition & 1 deletion apps/emqx_durable_storage/src/emqx_durable_storage.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{application, emqx_durable_storage, [
{description, "Message persistence and subscription replays for EMQX"},
% strict semver, bump manually!
{vsn, "0.1.1"},
{vsn, "0.1.2"},
{modules, []},
{registered, []},
{applications, [kernel, stdlib, rocksdb, gproc, mria]},
Expand Down

0 comments on commit 14b7691

Please sign in to comment.