Open ieQu1 opened 1 year ago
I have problems reproducing this with the instructions you gave, can you write a testcase in mnesia. There is a table type ext_ets and ext_dets default configured that you can use to remove the mnesia_rocksdb dependency.
Hello,
I think we found a reliable way to reproduce it in our own test suite. Porting to the OTP test suite may take time, since I am not familiar with it, but I might attempt it.
The steps are:
change_storage_type
. Would still like to have a testcase or some code that I can run which reproduces this.
ping @ieQu1
@dgud I have a testcase, how to send it to you?
Post it here, or add a gist. The testcase should be without mnesia_rocksdb I don't want to debug that.
@dgud I have re-uploaded erlang27 version, please check, thank you
I don't think I'm seeing the correct problem when running this:
Please verify, not familiar with rocksdb at all. Would it be possible to have a reproduction without mnesia_rocksdb?
Hello,
Sorry for no answer, I was head deep in other stuff. This problem is pretty rare (thankfully), so I don't know the precise conditions to trigger it. I pinpointed the function with a missing clause from the stacktrace, and have a preliminary fix, but no reliable way to test it.
Maybe OTP experts can suggest what scenarios can trigger various types of schema merge. Edit: apparently it's right there https://github.com/erlang/otp/issues/7423#issuecomment-1717553324
Hello,
Sorry for no answer, I was head deep in other stuff. This problem is pretty rare (thankfully), so I don't know the precise conditions to trigger it. I pinpointed the function with a missing clause from the stacktrace, and have a preliminary fix, but no reliable way to test it.
Maybe OTP experts can suggest what scenarios can trigger various types of schema merge.
But you mean that there is an error in your reproduction? And that's why I'm seeing this wrong stacktrace?
But otherwise this reproduction should trigger the error? After running a few times perhaps?
Your stacktrace looks different. You likely have stumbled on a different issue that looks specific to rocksdb:
{noproc,
{gen_server,call,
[mnesia_rocksdb_admin,
{rdb,{get_ref,t}},
infinity]}}
This doesn't look like a Mnesia process.
In our case, BUP was not involved. It happened after a regular node restart.
I don't think I'm seeing the correct problem when running this:
Please verify, not familiar with rocksdb at all. Would it be possible to have a reproduction without mnesia_rocksdb?
mnesia:add_backend_type(Alias, Module) after,If the table is empty,Everything is fine,because Module:init_backend first call. mnesia:add_backend_type(Alias, Module) after,If there's data in the table,mnesia:backup("bk.BUP") after mnesia:install_fallback("bk.BUP") after mnesia:start(),There will be bugs,because Module:init_backend not call.
Describe the bug
mnesia_schema.erl
contains the following code: https://github.com/erlang/otp/blob/f820bad7bed34cc4365bb9cac56eaa84c9a5bddc/lib/mnesia/src/mnesia_schema.erl#L3667This function is called during schema merging. However, it doesn't handle external storage backends created via
mnesia:add_backend_type
(e.g. https://github.com/aeternity/mnesia_rocksdb), causing the following error:To Reproduce
mnesia_rocksdb:register
) in a cluster of two nodes (A
andB
)B
, removing a remote table copy on the surviving nodeA
and restartingB
, but there could be an easier way.B
fails to start with this error.Expected behavior Schema is merged.
Affected versions Probably all OTP versions that support 3rd party backends.
Additional context