Skip to content

executor: flush statement should trigger implicit commit (#34134)#34183

Closed
ti-srebot wants to merge 1 commit intopingcap:release-2.1from
ti-srebot:release-2.1-d3a02f416aaa
Closed

executor: flush statement should trigger implicit commit (#34134)#34183
ti-srebot wants to merge 1 commit intopingcap:release-2.1from
ti-srebot:release-2.1-d3a02f416aaa

Conversation

@ti-srebot
Copy link
Contributor

@ti-srebot ti-srebot commented Apr 24, 2022

cherry-pick #34134 to release-2.1
You can switch your code base to this Pull Request by using git-extras:

# In tidb repo:
git pr https://github.com/pingcap/tidb/pull/34183

After apply modifications, you can push your change to this PR via:

git push git@github.com:ti-srebot/tidb.git pr/34183:release-2.1-d3a02f416aaa

What problem does this PR solve?

Issue Number: close #34180
See https://github.com/pingcap/enterprise-plugin/issues/68

Problem Summary:

What is changed and how it works?

Let flush statement commit the current transaction.

begin;
delete from mysql.tidb_audit_table_access ...
flush tidb plugins audit;
commit;

After deleting the record from mysql.tidb_audit_table_access, the audit log plugin still working,
that's because flush tidb plugins audit; doen't see the uncommitted delete statement.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

Flush statement now trigger an implicit commit when called inside a transaction

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has not been approved.

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Details

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Apr 24, 2022
@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-chi-bot ti-chi-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Apr 24, 2022
@ti-srebot ti-srebot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/2.1-cherry-pick labels Apr 24, 2022
@ti-chi-bot ti-chi-bot removed the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 24, 2022
@ti-srebot
Copy link
Contributor Author

@tiancaiamao you're already a collaborator in bot's repo.

@MimeLyc MimeLyc closed this Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. type/2.1-cherry-pick

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants