Skip to content
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

txn: make load data transactional #49079

Merged
merged 9 commits into from
Dec 18, 2023

Conversation

ekexium
Copy link
Contributor

@ekexium ekexium commented Dec 1, 2023

What problem does this PR solve?

Issue Number: ref #49078

What changed and how does it work?

Make `LOAD DATA` statements behave normally in a transaction.
Previously the `LOAD DATA` statement commits the current transaction, start a new transaction for its own use and commit it immediately after the statement.
The PR fixes the issue and make `LOAD DATA` behave like other normal DMLs. It doesn't create txn for its own and respects the rollback or commit action of its surrounding transaction.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

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.

Make `LOAD DATA` statements behave normally in a transaction.
Previously the `LOAD DATA` statement commits the current transaction, start a new transaction for its own use and commit it immediately after the statement.
The PR fixes the issue and make `LOAD DATA` behave like other normal DMLs. It doesn't create txn for its own and respects the rollback or commit action of its surrounding transaction.

Copy link

ti-chi-bot bot commented Dec 1, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 1, 2023
Copy link

tiprow bot commented Dec 1, 2023

Hi @ekexium. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ekexium
Copy link
Contributor Author

ekexium commented Dec 1, 2023

/test all

Copy link

tiprow bot commented Dec 1, 2023

@ekexium: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test all

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link

codecov bot commented Dec 1, 2023

Codecov Report

Merging #49079 (821df04) into master (074af10) will increase coverage by 0.7073%.
Report is 4 commits behind head on master.
The diff coverage is 20.1388%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #49079        +/-   ##
================================================
+ Coverage   70.9977%   71.7051%   +0.7073%     
================================================
  Files          1368       1418        +50     
  Lines        399517     432866     +33349     
================================================
+ Hits         283648     310387     +26739     
- Misses        96068     103361      +7293     
+ Partials      19801      19118       -683     
Flag Coverage Δ
integration 43.7927% <6.1538%> (?)
unit 71.0256% <72.5000%> (+0.0279%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 53.9663% <ø> (ø)
parser ∅ <ø> (∅)
br 47.7824% <ø> (-5.1124%) ⬇️

@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 4, 2023
@ekexium
Copy link
Contributor Author

ekexium commented Dec 5, 2023

/test all

Copy link

tiprow bot commented Dec 5, 2023

@ekexium: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test all

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ekexium ekexium force-pushed the load-data-stmt-transactional branch from 2dcfac9 to 441d219 Compare December 5, 2023 09:50
@ekexium
Copy link
Contributor Author

ekexium commented Dec 5, 2023

/test all

Copy link

tiprow bot commented Dec 5, 2023

@ekexium: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test all

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ekexium ekexium force-pushed the load-data-stmt-transactional branch from 441d219 to 7b0d7d4 Compare December 5, 2023 10:51
@ekexium
Copy link
Contributor Author

ekexium commented Dec 6, 2023

/test all

Copy link

tiprow bot commented Dec 6, 2023

@ekexium: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test all

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ekexium ekexium force-pushed the load-data-stmt-transactional branch from 7b0d7d4 to adb0f2a Compare December 6, 2023 02:20
@ekexium ekexium marked this pull request as ready for review December 6, 2023 02:20
@ekexium ekexium changed the title [WIP] txn: make load data transactional txn: make load data transactional Dec 6, 2023
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 6, 2023
@ekexium ekexium force-pushed the load-data-stmt-transactional branch 4 times, most recently from 33be1be to 93811db Compare December 6, 2023 06:13
@ekexium ekexium force-pushed the load-data-stmt-transactional branch 2 times, most recently from 4409ae4 to 859cd2f Compare December 14, 2023 14:30
…lder drain the connection when error occurs

Signed-off-by: ekexium <[email protected]>
@ekexium ekexium force-pushed the load-data-stmt-transactional branch from 859cd2f to f974e43 Compare December 14, 2023 14:31
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Dec 15, 2023
@cfzjywxk cfzjywxk requested review from you06 and lance6716 December 15, 2023 07:34
Copy link
Contributor

@cfzjywxk cfzjywxk left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Dec 15, 2023
Copy link

ti-chi-bot bot commented Dec 15, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-12-15 06:05:29.040751593 +0000 UTC m=+595420.077978520: ☑️ agreed by zyguan.
  • 2023-12-15 07:34:36.605862879 +0000 UTC m=+600767.643089809: ☑️ agreed by cfzjywxk.

@cfzjywxk
Copy link
Contributor

@lance6716 @you06
PTAL

Copy link

tiprow bot commented Dec 15, 2023

@ekexium: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
tiprow_fast_test 06bcc13 link true /test tiprow_fast_test

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@lance6716
Copy link
Contributor

/retest

@lance6716
Copy link
Contributor

/hold

wait for @you06 's review

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 15, 2023
Copy link

tiprow bot commented Dec 15, 2023

@lance6716: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ekexium
Copy link
Contributor Author

ekexium commented Dec 18, 2023

/retest

Copy link

tiprow bot commented Dec 18, 2023

@ekexium: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link

ti-chi-bot bot commented Dec 18, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cfzjywxk, lance6716, you06, zyguan

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

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [cfzjywxk,lance6716,you06,zyguan]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@lance6716
Copy link
Contributor

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 18, 2023
@ti-chi-bot ti-chi-bot bot merged commit 9fad344 into pingcap:master Dec 18, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants