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: fix race in p-dml caused by Transaction.SetOption running with background flushing #51913

Merged
merged 14 commits into from
Mar 22, 2024

Conversation

you06
Copy link
Contributor

@you06 you06 commented Mar 19, 2024

What problem does this PR solve?

Issue Number: ref #50215 close #52028

Problem Summary:

What changed and how does it work?

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.
» go test ./tests/realtikvtest/pipelineddmltest --tags=intest -race
# github.com/pingcap/tidb/tests/realtikvtest/pipelineddmltest.test
ok      github.com/pingcap/tidb/tests/realtikvtest/pipelineddmltest     64.319s

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.

None

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 19, 2024
Copy link

tiprow bot commented Mar 19, 2024

Hi @you06. 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.

@you06
Copy link
Contributor Author

you06 commented Mar 19, 2024

lol, it's not empty...

external/com_github_tikv_client_go_v2/txnkv/transaction/txn.go:70:2: "github.com/tikv/client-go/v2/util/intest" imported as empty and not used
external/com_github_tikv_client_go_v2/txnkv/transaction/txn.go:1671:6: undefined: intest

Copy link

codecov bot commented Mar 19, 2024

Codecov Report

Merging #51913 (7ad48e5) into master (b91a1b3) will decrease coverage by 17.7665%.
Report is 12 commits behind head on master.
The diff coverage is 100.0000%.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #51913         +/-   ##
=================================================
- Coverage   72.4334%   54.6669%   -17.7665%     
=================================================
  Files          1481       1592        +111     
  Lines        365290     610436     +245146     
=================================================
+ Hits         264592     333707      +69115     
- Misses        81150     253476     +172326     
- Partials      19548      23253       +3705     
Flag Coverage Δ
integration 36.7725% <78.1250%> (?)
unit 70.4264% <100.0000%> (-1.9008%) ⬇️

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

Components Coverage Δ
dumpling 53.9957% <ø> (-2.3014%) ⬇️
parser ∅ <ø> (∅)
br 51.4852% <ø> (+5.1066%) ⬆️

@you06
Copy link
Contributor Author

you06 commented Mar 20, 2024

/retest

Copy link

tiprow bot commented Mar 20, 2024

@you06: 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.

Signed-off-by: you06 <you1474600@gmail.com>
Signed-off-by: you06 <you1474600@gmail.com>
Signed-off-by: you06 <you1474600@gmail.com>
Signed-off-by: you06 <you1474600@gmail.com>
Signed-off-by: you06 <you1474600@gmail.com>
Signed-off-by: you06 <you1474600@gmail.com>
Signed-off-by: you06 <you1474600@gmail.com>
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 21, 2024
@you06
Copy link
Contributor Author

you06 commented Mar 21, 2024

The testing flag not work in CI...

Signed-off-by: you06 <you1474600@gmail.com>
Signed-off-by: you06 <you1474600@gmail.com>
@you06
Copy link
Contributor Author

you06 commented Mar 21, 2024

Ok it works.

image

Signed-off-by: you06 <you1474600@gmail.com>
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 21, 2024
Signed-off-by: you06 <you1474600@gmail.com>
Signed-off-by: you06 <you1474600@gmail.com>
ekexium
ekexium approved these changes Mar 22, 2024
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Mar 22, 2024
@you06 you06 changed the title txn: fix race in p-dml and check possible race for Transaction.SetOption when testing txn: fix race in p-dml caused by Transaction.SetOption running with background flushing Mar 22, 2024
Signed-off-by: you06 <you1474600@gmail.com>
pkg/executor/executor.go Show resolved Hide resolved
pkg/executor/update.go Show resolved Hide resolved
pkg/session/session.go Show resolved Hide resolved
Copy link

ti-chi-bot bot commented Mar 22, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cfzjywxk, ekexium

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:

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

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Mar 22, 2024
Copy link

ti-chi-bot bot commented Mar 22, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-03-22 08:15:03.228048081 +0000 UTC m=+1623730.250294469: ☑️ agreed by ekexium.
  • 2024-03-22 08:22:31.230617468 +0000 UTC m=+1624178.252863855: ☑️ agreed by cfzjywxk.

@ekexium
Copy link
Contributor

ekexium commented Mar 22, 2024

/run-check-issue-triage-complete

Signed-off-by: you06 <you1474600@gmail.com>
ti-chi-bot bot pushed a commit that referenced this pull request Mar 22, 2024
@ti-chi-bot ti-chi-bot bot merged commit f23c6fc into pingcap:master Mar 22, 2024
21 checks passed
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: failed to apply #51913 on top of branch "release-8.0":

failed to git commit: exit status 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-8.0 release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

p-dml: race risk when concurrent accessing txn options
4 participants