MDEV-30307 KILL command inside a transaction causes problem for galer… #2397
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.
…a replication
Description
If KILL command is submitted inside a transaction, galera replication may have problems to deal with cluster conflict resolving. One failure scenario is if the transaction (submitting the KILL command) is it self a victim of BF aborting. Eternal hang of the node may result.
sql_kill() and sql_kill_user() functions have now fix, to perform implicit commit before starting the KILL command execution. Because of the implicit commit, the KILL execution will not happen inside transaction context anymore.
How can this PR be tested?
Added new test scenario in galera.galera_bf_kill test to make the issue surface, The test scenario has a multi statement transaction containing a KILL command. When the KILL is submitted, another transaction is replicated, which causes BF abort for the KILL command processing. Handling BF abort rollback while executing KILL command causes node hanging, in this scenario.
.
Basing the PR against the correct MariaDB version
Backward compatibility
This change is deviation of stand-alone MariaDB behavior. With the fix, the transaction will be implicitly committed before the KILL command execution.