emqx / emqx/mria

Race condition when creating mnesia schema

Open
#129 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Erlang
Stars
158
Forks
22
PR merge metrics
No merged PRs in 30d

Description

```
=ERROR REPORT==== 8-Mar-2023::13:50:12.394847 ===
Mnesia('n3@127.0.0.1'): ** ERROR ** (core dumped to file: "/home/me/Documents/work/mria/_build/test/logs/ct_run.nonode@nohost.2023-03-08_13.50.06/MnesiaCore.n3@127.0.0.1_1678_279812_394238")
** FATAL ** mnesia_tm crashed: {badarg,
[{erlang,unlink,
[undefined],
[{error_info,
#{module => erl_erts_errors}}]},
{mnesia_controller,
release_schema_commit_lock,0,
[{file,"mnesia_controller.erl"},
{line,332}]},
{mnesia_dumper,update,3,
[{file,"mnesia_dumper.erl"},{line,300}]},
{mnesia_tm,do_commit,3,
[{file,"mnesia_tm.erl"},{line,1781}]},
{mnesia_tm,recover_coordinator,2,
[{file,"mnesia_tm.erl"},{line,598}]},
{mnesia_tm,handle_exit,3,
[{file,"mnesia_tm.erl"},{line,575}]},
{mnesia_sp,init_proc,4,
[{file,"mnesia_sp.erl"},{line,34}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,240}]}]} state: [<0.295.0>]
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Begin with the stack trace at mnesia_controller.erl line 332, then follow the mnesia_dumper:update/3 and mnesia_tm recovery paths shown. Reproduce concurrent schema creation and consider the issue done when the crash is prevented and the race is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
erlang
Domain
databases, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.