Describe the bug
mnesia:force_load_table/1 may stuck after a peer node becomes unavailable while loading tables from it.
To Reproduce
Two similar cases were discovered.
To reproduce the first one:
- Create schema and start Mnesia on two nodes.
- Create and populate
disc_copies table.
- On the first node, set the second node as master node for all tables.
- Restart Mnesia on the first node.
- Break connectivity while the table is loading.
- On the first node, wait until the second node becomes unavailable.
- On the first node, force the table to be loaded immediately.
mnesia:force_load_table/1 gets stuck. The second call to the function loads the table. As a workaround, a small delay can be added before the call.
The second case differs by using a disc_only_copies table and adding a one-second delay before calling mnesia:force_load_table/1.
mnesia:force_load_table/1 gets stuck. The same thing happens on subsequent calls to the function.
Expected behavior
mnesia:force_load_table/1 loads the table and returns control.
Affected versions
At least OTP-27.1.2, OTP-28.5.0.3, and OTP-29.0.3.
Additional context
Code to reproduce and instructions on how to run it are in attached zip file.
mnesia-force-load-table-stuck-master.zip
Describe the bug
mnesia:force_load_table/1may stuck after a peer node becomes unavailable while loading tables from it.To Reproduce
Two similar cases were discovered.
To reproduce the first one:
disc_copiestable.mnesia:force_load_table/1gets stuck. The second call to the function loads the table. As a workaround, a small delay can be added before the call.The second case differs by using a
disc_only_copiestable and adding a one-second delay before callingmnesia:force_load_table/1.mnesia:force_load_table/1gets stuck. The same thing happens on subsequent calls to the function.Expected behavior
mnesia:force_load_table/1loads the table and returns control.Affected versions
At least
OTP-27.1.2,OTP-28.5.0.3, andOTP-29.0.3.Additional context
Code to reproduce and instructions on how to run it are in attached zip file.
mnesia-force-load-table-stuck-master.zip