Conversation
When the provider delivers the SYNCED event while the server is still in donor state, on_sync() attempted a direct donor -> synced transition, which is not allowed and aborts in a debug build. This happens when SYNCED arrives before sst_sent() had a chance to return the server from donor to joined. Anticipate JOINED in on_sync() via return_from_donor_state() so the transition goes donor -> joined -> synced, mirroring what the initial sync branch already does. Add a wsrep-lib unit test covering on_sync() in donor state.
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.
Problem
In a debug build,
galera.galera_wan(andgalera_vote_rejoin_ddl) can abort with:server: unallowed state transition: donor -> synced
Assertion `0' failed. // wsrep-lib/src/server_state.cpp:1371
The donor exit path is
donor -> joined -> synced. Thedonor -> joinedstep is synthesized insst_sent()/return_from_donor_state()because the v26 provider API has no JOINED event. But the provider's SYNCED callback (on_sync()) can arrive beforesst_sent()runs, while the server is stills_donor, and the post-init branch ofon_sync()then attempts the forbiddendonor -> synced.It is a race between two threads, serialized by
server_state::mutex_for atomicity but not for ordering:sst_donor_thread) →sst_sent()→return_from_donor_state()→donor -> joinedwsrep_->recv()) →synced_cb→on_sync()→... -> syncedFix
In the post-init branch of
on_sync(), anticipate JOINED before going to synced, reusing the existing helper (mirrors what the initial-sync branch already does):return_from_donor_state() only acts when state == s_donor, so it is a no-op in every other case.
Testing