diff options
author | Dan Gudmundsson <[email protected]> | 2016-10-11 15:19:10 +0200 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2016-10-11 15:19:10 +0200 |
commit | 82d1b7b4c79cef54f04e062f04b696544609a25b (patch) | |
tree | 85ceb23d7df2e82e40cd69d04be6314dea14b0b4 /lib/mnesia/src/mnesia_controller.erl | |
parent | a59807ef9a6a8af6eb6f13976eb405ddb9baad6c (diff) | |
download | otp-82d1b7b4c79cef54f04e062f04b696544609a25b.tar.gz otp-82d1b7b4c79cef54f04e062f04b696544609a25b.tar.bz2 otp-82d1b7b4c79cef54f04e062f04b696544609a25b.zip |
mnesia: Fix double blocked tables which could cause a crash
Fast restarts could cause table to be blocked twice.
Diffstat (limited to 'lib/mnesia/src/mnesia_controller.erl')
-rw-r--r-- | lib/mnesia/src/mnesia_controller.erl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/mnesia/src/mnesia_controller.erl b/lib/mnesia/src/mnesia_controller.erl index 4791e2e290..17b47c059e 100644 --- a/lib/mnesia/src/mnesia_controller.erl +++ b/lib/mnesia/src/mnesia_controller.erl @@ -1703,9 +1703,10 @@ add_active_replica(Tab, Node, Cs = #cstruct{}) -> block_table(Tab) -> Var = {Tab, where_to_commit}, - Old = val(Var), - New = {blocked, Old}, - set(Var, New). % where_to_commit + case is_tab_blocked(val(Var)) of + {true, _} -> ok; + {false, W2C} -> set(Var, mark_blocked_tab(true, W2C)) + end. unblock_table(Tab) -> call({unblock_table, Tab}). |