Do not wait for ?rlog_sync table - #199
Merged
Merged
Conversation
ieQu1
force-pushed
the
dev/force-load-rlog_sync-table
branch
from
February 9, 2026 12:46
4aa0640 to
6a58a49
Compare
ieQu1
commented
Feb 9, 2026
| [ {mria, db_backend, rlog} | ||
| , {mria, rlog_startup_shards, [test_shard]} | ||
| , {mria, strict_mode, true} | ||
| , {mria, rpc_module, gen_rpc} |
Member
Author
There was a problem hiding this comment.
Note: we no longer use gen_rpc as a transport in production.
ieQu1
force-pushed
the
dev/force-load-rlog_sync-table
branch
2 times, most recently
from
February 9, 2026 12:49
f73ad61 to
8865d60
Compare
There was a problem hiding this comment.
Pull request overview
This PR adjusts Mria startup/schema bootstrap behavior to avoid getting stuck waiting on the ?rlog_sync table, and adds/updates CT coverage to exercise full cluster restart scenarios.
Changes:
- Remove blocking waits for
?rlog_syncduring schema bootstrap and introduce a local force-load step instead. - Reduce
mria_mnesia:wait_for_tables/1per-iteration wait timeout (30s → 5s) before retry/diagnostics. - Update/add CT suites to better simulate realistic cluster conditions and validate full cluster restart behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/mria_mnesia_test_util.erl | Removes an unused/ineffective env setting from common test env. |
| test/mria_autoclean_SUITE.erl | Makes autoclean test run with a replicant and adds more “realistic” setup steps. |
| test/mria_SUITE.erl | Adds a new full-cluster-restart testcase and updates copyright year. |
| src/mria_schema.erl | Stops waiting on ?rlog_sync and adds a force_load/1 helper during bootstrap. |
| src/mria_mnesia.erl | Lowers the wait timeout used by wait_for_tables/1 retry loop. |
Comments suppressed due to low confidence (1)
src/mria_mnesia.erl:280
- Reducing the
mnesia:wait_for_tables/2timeout from 30s to 5s increases the frequency of the timeout path, which logs a warning, runs diagnostics, and callsmnesia_controller:connect_nodes/1before retrying. This can significantly increase log volume and connection churn in slow/large clusters. Consider keeping a larger default, adding a backoff, or making the timeout configurable.
case mnesia:wait_for_tables(Tables, 5_000) of
ok ->
?tp(mria_wait_for_tables_done, #{result => ok}),
ok;
{error, Reason} ->
?tp(mria_wait_for_tables_done, #{result => {error, Reason}}),
{error, Reason};
{timeout, BadTables} ->
logger:warning("~p: still waiting for table(s): ~p", [?MODULE, BadTables]),
catch diagnosis(BadTables),
%% lets try to force reconnect all the db_nodes to get schema merged,
%% mnesia_controller is smart enough to not force reconnect the node that is already connected.
mnesia_controller:connect_nodes(mnesia:system_info(db_nodes)),
wait_for_tables(BadTables)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ieQu1
force-pushed
the
dev/force-load-rlog_sync-table
branch
from
February 9, 2026 13:48
8865d60 to
ce270d6
Compare
ieQu1
force-pushed
the
dev/force-load-rlog_sync-table
branch
from
February 9, 2026 14:40
ce270d6 to
e2c382f
Compare
zmstone
approved these changes
Feb 9, 2026
thalesmg
reviewed
Feb 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Speed up cluster restart by not waiting for the master of
?rlog_synctable. It's anull_copiestable used solely for the events, its contents are irrelevant.