-
Notifications
You must be signed in to change notification settings - Fork 3k
Michal/mnesia/add_tests_for_compare_storage_type #9444
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
Michal/mnesia/add_tests_for_compare_storage_type #9444
Conversation
CT Test Results 2 files 59 suites 20m 12s ⏱️ For more details on these failures, see this check. Results for commit f09ed97. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts// Erlang/OTP Github Action Bot |
?match({atomic, ok}, mnesia:change_table_copy_type(tab, N1, disc_copies)), | ||
|
||
?match(ok, rpc:call(N2, mnesia, start, [[{extra_db_nodes, [N1]}, {schema, ?BACKEND}]])), | ||
?verify_mnesia(All, []), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?verify_mnesia(All, []), | |
?verify_mnesia(All, [tab]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added check if table type was changed instead.
?match({atomic, ok}, mnesia:change_table_copy_type(tab, N1, disc_only_copies)), | ||
|
||
?match(ok, rpc:call(N2, mnesia, start, [[{extra_db_nodes, [N1]}, {schema, ?BACKEND}]])), | ||
?verify_mnesia(All, []). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?verify_mnesia(All, []). | |
?verify_mnesia(All, [tab]). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added check if table type was changed instead.
54cb7c6
to
74f663b
Compare
74f663b
to
f09ed97
Compare
f09ed97
to
2606259
Compare
2606259
to
f1a5aa3
Compare
Those tests are related to #9311.
When investigating problem during schema merge it was found that when some nodes in the cluster are down, it's still possible to call
mnesia:change_table_copy_type/3
for 2 special cases:The cause of this is that
mnesia_schema:compare_storage_types/3
does not consider the two (mentioned above) conversions as incompatible, this can be seen here:otp/lib/mnesia/src/mnesia_schema.erl
Lines 3661 to 3664 in 5dab31e
The cause is in
mnesia_schema:make_change_table_copy_type/3
, one can see that only when storage type isincompatible
, it callsensure_active(Cs)
otp/lib/mnesia/src/mnesia_schema.erl
Lines 1891 to 1898 in 5dab31e
In addition to that:
is used for merging a schema after it's removal (when node rejoins the cluster), this can be seen in
mnesia_config_test:dynamic_basic/1
when doing following operations:otp/lib/mnesia/test/mnesia_config_test.erl
Lines 1114 to 1120 in 5dab31e
The cause of that is when we remove node's schema it restarts with
ram_copies
schema, and later has to join a cluster and convert it's schema todisc_copies
.This is mentioned in the documentation: https://www.erlang.org/doc/apps/mnesia/mnesia.html#module-configuration-parameters
but
is not covered by any tests, so add tests for both of those cases.