Skip to content

MDEV-23077: --flashback + --table produces buggy results #3968

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

Open
wants to merge 2 commits into
base: 10.11
Choose a base branch
from

Conversation

ParadoxV5
Copy link
Contributor

What problem is the patch trying to solve?

  • Events of skipped tables were still queued and generates extraneous “Row event for unknown table” when flashing back.
  • Skipping a statement-end event left prior non-skipped events processed incompletely.

How can this PR be tested?

#1674 provided a < CASE 8 > for binlog.flashback which I simplified and corrected (?) to cover both bullet points.
It also adds a < CASE 9 > checking the similar --database excludes the not-specified database.

PR quality check

  • This is a new feature or a refactoring, and the PR is based against the main branch.
  • This is a bug fix, and the PR is based against the earliest maintained branch in which the bug can be reproduced.
  • I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
  • For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.

* Events of skipped tables were still queued and generates
  extraneous “Row event for unknown table” when flashing back.
* Skipping a statement-end event left prior
  non-skipped events processed incompletely.

Co-Authored-By: lukexwang <[email protected]>
@ParadoxV5 ParadoxV5 added MariaDB Corporation Replication Patches involved in replication labels Apr 12, 2025
@ParadoxV5 ParadoxV5 requested a review from andrelkin April 12, 2025 02:11
--echo #
--echo # MDEV-30698 Cover missing test cases for mariadb-binlog options
--echo # --raw [and] --flashback
--echo #

--error 1 # --raw mode and --flashback mode are not allowed
--exec $MYSQL_BINLOG -vv -B --raw --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000003> $MYSQLTEST_VARDIR/tmp/mysqlbinlog_row_flashback_8.sql
--exec $MYSQL_BINLOG -vv -B --raw --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000003> $MYSQLTEST_VARDIR/tmp/mysqlbinlog_row_flashback_0.sql
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a real Case 8 now.

@@ -955,14 +955,14 @@ static bool print_row_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
}

/* skip the event check */
if (skip_event)
if (skip_event && !(opt_flashback && is_stmt_end))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What #1674 did was copy-pasting the else branch of the next if to the previous if tree as a new branch for (skip_event && opt_flashback && is_stmt_end).
Here, I reimplement it by skipping this intermediate “step” (?) for that exact condition.

While the diff is now smaller, it has become proof that our code is 🍝.

* Events of skipped databases were still queued and generates
  extraneous “Row event for unknown table” when flashing back.
* Skipping a statement-end event left prior
  non-skipped events processed incompletely.
@ParadoxV5
Copy link
Contributor Author

  • TODO: I forgot to clarify in Commit 2’s descripton that the bugs described were already fixed in Commit 1.
    If I drop by the past again, I should amend it back in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MariaDB Corporation Replication Patches involved in replication
Development

Successfully merging this pull request may close these issues.

1 participant