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

*: fix data race in ProcessInfo #45127

Merged
merged 5 commits into from
Jul 5, 2023

Conversation

wshwsh12
Copy link
Contributor

@wshwsh12 wshwsh12 commented Jul 3, 2023

What problem does this PR solve?

Issue Number: close #45126

Problem Summary:

What is changed and how it works?

Clone some fields from stmtContext to ProcessInfo.

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.

None

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/needs-triage-completed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 3, 2023
@tiprow
Copy link

tiprow bot commented Jul 3, 2023

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

@wshwsh12 wshwsh12 requested a review from XuHuaiyu July 3, 2023 09:02
@ti-chi-bot ti-chi-bot bot added needs-cherry-pick-release-5.3 Type: Need cherry pick to release-5.3 needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. and removed do-not-merge/needs-triage-completed labels Jul 3, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 3, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 3, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 3, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 3, 2023
@XuHuaiyu XuHuaiyu added the type/bugfix This PR fixes a bug. label Jul 3, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 3, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 3, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 3, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 3, 2023
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jul 3, 2023
Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

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

I just want to know that why #39368 could not avoid this data race.

@wshwsh12
Copy link
Contributor Author

wshwsh12 commented Jul 4, 2023

I just want to know that why #39368 could not avoid this data race.

#39368 avoid data race from the function (s *SessionVars).InitStatementContext by calling s.RefCountOfStmtCtx.TryFreeze()
If you want to use RefCountOfStmtCtx to avoid this data race, we need call s.RefCountOfStmtCtx.TryFreeze() in some functions in builder.go file.

@hawkingrei
Copy link
Member

/lgtm

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

ti-chi-bot bot commented Jul 5, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-07-03 10:14:43.500054005 +0000 UTC m=+26115.433687427: ☑️ agreed by XuHuaiyu.
  • 2023-07-05 06:36:29.916755513 +0000 UTC m=+185821.850388996: ☑️ agreed by hawkingrei.

@ti-chi-bot
Copy link

ti-chi-bot bot commented Jul 5, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hawkingrei, XuHuaiyu

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 [XuHuaiyu,hawkingrei]

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

@tiprow
Copy link

tiprow bot commented Jul 5, 2023

@wshwsh12: 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 f18f0ff 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.

@ti-chi-bot ti-chi-bot bot merged commit af04707 into pingcap:master Jul 5, 2023
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.5: #45171.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jul 5, 2023
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #45172.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jul 5, 2023
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-5.3: #45173.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jul 5, 2023
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-5.4: #45174.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jul 5, 2023
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.1: #45175.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jul 5, 2023
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
ti-chi-bot bot pushed a commit that referenced this pull request Jul 11, 2023
ti-chi-bot bot pushed a commit that referenced this pull request Aug 4, 2023
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-5.3 Type: Need cherry pick to release-5.3 needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. 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. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

data race in Processinfo with index scan
5 participants