forked from MariaDB/server
-
Notifications
You must be signed in to change notification settings - Fork 2
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
10.6-MDEV-31272 statement rollback causing empty write set replication #325
Open
sjaakola
wants to merge
9
commits into
10.6
Choose a base branch
from
10.6-MDEV-31272
base: 10.6
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
If a statement execution has successfully modified some rows, then the write set for the transaction, will be appended by the key values related to the modified rows. If the staement execution eventually fails, e.g. for duplicate key error, then statement rollback will be carried out, to undo changes in storage engine and truncate binlog cache to wipe out replication events related to the statement execution. If the transaction has no other successful write statements then there is nothing to commit, at commit time, and no binlog events either. But as there were earlier key appends, the transaction remains registred for wsrep replication, and at commit time replicator extracts binlog events from cache and populates the final write set for the replication. In the buggy version, it was observed that there are no binlog events, but the write set was populated, nevertheless, and the empty write set was replicated. Note that this consumes one GTID, for a void operation. The fix for this issue, cancels the replication of such empty write set anf gives a warning for the client. This fix is in: Wsrep_client_service::prepare_data_for_replication() It also turned out that the binlog cache truncate for statement rollback was not complete if server was not configured to use binloggging. In buggy version, only statmenet cache was truncated, but events remained in the transaction cache. This has been fixed in wsrep_thd_binlog_stmt_rollback()
binlog_commit maintains also binlog cache, which is needed also when binlogging is not used, e.g. to support steement rollback
…have empty last WS carrying only commit flag
methods for managing binlog cache when actual binlog is not used
…ines mtr test galera.galera_ctas should pass with this patch
test_pr |
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.
If a statement execution has successfully modified some rows, then the write set for the transaction, will be appended by the key values related to the modified rows. If the staement execution eventually fails, e.g. for duplicate key error, then statement rollback will be carried out, to undo changes in storage engine and truncate binlog cache to wipe out replication events related to the statement execution.
If the transaction has no other successful write statements then there is nothing to commit, at commit time, and no binlog events either. But as there were earlier key appends, the transaction remains registred for wsrep replication, and at commit time replicator extracts binlog events from cache and populates the final write set for the replication. In the buggy version, it was observed that there are no binlog events, but the write set was populated, nevertheless, and the empty write set was replicated. Note that this consumes one GTID, for a void operation.
The fix for this issue, cancels the replication of such empty write set anf gives a warning for the client.
This fix is in: Wsrep_client_service::prepare_data_for_replication()
It also turned out that the binlog cache truncate for statement rollback was not complete if server was not configured to use binloggging. In buggy version, only statmenet cache was truncated, but events remained in the transaction cache. This has been fixed in wsrep_thd_binlog_stmt_rollback()