-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
*: reduce ResetContextOfStmt() object allocation #26241
*: reduce ResetContextOfStmt() object allocation #26241
Conversation
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
@@ -543,7 +543,6 @@ func (s *testTableSuite) TestSomeTables(c *C) { | |||
Command: byte(1), | |||
Digest: "abc1", | |||
State: 1, | |||
StmtCtx: tk.Se.GetSessionVars().StmtCtx, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take out tk.Se.GetSessionVars().StmtCtx
for future use is not correct, it's not a snapshot.
The correct usage should be Lock -> Read data -> Unlock for process info ...
See #26196
@@ -2169,7 +2169,6 @@ func (s *testSuite4) TestLoadData(c *C) { | |||
{[]byte("\t2\t3"), []byte("\t4\t5"), nil, []byte("\t2\t3\t4\t5"), "Records: 0 Deleted: 0 Skipped: 0 Warnings: 0"}, | |||
} | |||
checkCases(tests, ld, c, tk, ctx, selectSQL, deleteSQL) | |||
c.Assert(sc.WarningCount(), Equals, uint16(1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is incorrect. The warnings is reset after the next statement.
The correct behavior should be check warning immediately after a statement.
The old code rely on every time a new statement context is allocated ... so even it does not checked immediately, the data is not overwritten.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/merge |
/merge cancel DATA RACE detected
|
After #26909 the DATA RACE should be OK |
/merge |
/run-unit-test |
This seems to be a unstable test on the master branch but it seems to become reproducable in this branch.
|
@tiancaiamao: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. 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 ti-community-infra/tichi repository. |
/merge cancel |
Wait for this one #26538 to be fixed. |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: e3fbf8f
|
What problem does this PR solve?
Reduce object allocation for #25573
Problem Summary:
What is changed and how it works?
What's Changed:
The tests are modified because they are incorrect.
How it Works:
Use two statement context add switch between them, so the allocation of
StatementContext
is almost eliminated.Check List
Tests
Allocate size per op drop from 7054 to 5902 ... it means the speed of garbage generation is slower
Side effects
Documentation
Release note