-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
*: avoid special cases DATA RACE #38918
Conversation
[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. |
return col.elemBuf == nil | ||
} | ||
|
||
return id == cap(col.elemBuf) |
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.
s/id/sizeClass?
When this may differ? caused by exchange column?
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.
(c *Column) Reset can change column type
modified: executor/builder.go modified: executor/distsql.go modified: executor/executor.go modified: executor/index_lookup_hash_join.go modified: executor/index_lookup_join.go modified: executor/index_lookup_merge_join.go modified: executor/index_merge_reader.go modified: executor/join.go modified: executor/joiner.go modified: executor/pipelined_window.go modified: executor/window.go modified: server/conn.go modified: server/conn_stmt.go modified: sessionctx/variable/session.go modified: sessionctx/variable/session_test.go modified: testkit/testkit.go
modified: sessionctx/variable/session.go
modified: sessionctx/variable/session.go modified: sessionctx/variable/session_test.go
/run-check_dev_2 |
sessionctx/variable/session.go
Outdated
@@ -1354,8 +1341,20 @@ func (s *SessionVars) SetAlloc(alloc chunk.Allocator) { | |||
} | |||
|
|||
// ClearAlloc indicates stop reuse chunk | |||
func (s *SessionVars) ClearAlloc() { | |||
func (s *SessionVars) ClearAlloc(cc *chunk.Allocator, err bool) { |
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.
err is usually an abbreviation for error
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.
done
sessionctx/variable/session.go
Outdated
@@ -96,6 +96,12 @@ type RetryInfo struct { | |||
LastRcReadTS uint64 | |||
} | |||
|
|||
// ReuseChunkPool save Alloc object | |||
type ReuseChunkPool struct { | |||
Lock sync.Mutex |
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.
In general. Mutex's name is mu.
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.
ok
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.
done
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 1e8259b
|
/run-unit-test |
In response to a cherrypick label: new pull request created: #38981. |
TiDB MergeCI notify🔴 Bad News! New failing [1] after this pr merged.
|
Did you test the performance for transfer workload by this PR? I found that you replace the |
Tested, the performance impact is relatively small, and safety is the priority |
What problem does this PR solve?
Issue Number: ref #38914
Problem Summary:
What is changed and how it works?
Replacing alloc when sql executes an error. Prevent unfinished Goroutines from continuing to use session alloc
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.