-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mnesia is unable to merge the schema for tables using external storage backends #7423
Comments
I have problems reproducing this with the instructions you gave, can you write a testcase in mnesia. |
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:
|
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. |
I don't think I'm seeing the correct problem when running this: Please verify, not familiar with rocksdb at all. |
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 #7423 (comment) |
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:
This doesn't look like a Mnesia process. In our case, BUP was not involved. It happened after a regular node restart. |
mnesia:add_backend_type(Alias, Module) after,If the table is empty,Everything is fine,because Module:init_backend first call. |
Couple of questions about this process:
|
Hi @Mikaka27
|
Hi, I'm having trouble to reproduce this problem.
And also it would be good to see how you initialize the schema on each node. |
Describe the bug
mnesia_schema.erl
contains the following code:otp/lib/mnesia/src/mnesia_schema.erl
Line 3667 in f820bad
This 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
The text was updated successfully, but these errors were encountered: