-
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
enhance graceful stop by closing the connection after finishing the ongoing txn #32110
Labels
affects-6.5
This bug affects the 6.5.x(LTS) versions.
sig/sql-infra
SIG: SQL Infra
type/enhancement
The issue or PR belongs to an enhancement.
Comments
12 tasks
12 tasks
ti-chi-bot
pushed a commit
that referenced
this issue
Mar 15, 2023
Merged
12 tasks
12 tasks
crazycs520
pushed a commit
to crazycs520/tidb
that referenced
this issue
Nov 29, 2023
12 tasks
crazycs520
added a commit
that referenced
this issue
Nov 29, 2023
… ongoing txn (#32111) (#48905) (#48989) close #32110 Co-authored-by: Ti Chi Robot <[email protected]>
crazycs520
pushed a commit
to crazycs520/tidb
that referenced
this issue
Nov 29, 2023
12 tasks
crazycs520
added a commit
that referenced
this issue
Nov 29, 2023
close #32110 Co-authored-by: Ti Chi Robot <[email protected]>
5 tasks
This was referenced Dec 2, 2023
5 tasks
guoshouyan
pushed a commit
to guoshouyan/tidb
that referenced
this issue
Mar 5, 2024
… ongoing txn (pingcap#32111) (pingcap#48905) (pingcap#29) close pingcap#32110 Co-authored-by: Ti Chi Robot <[email protected]>
guoshouyan
pushed a commit
to guoshouyan/tidb
that referenced
this issue
Mar 5, 2024
…8944) (pingcap#48990) (pingcap#32) close pingcap#32110 Co-authored-by: crazycs <[email protected]> Co-authored-by: Ti Chi Robot <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
affects-6.5
This bug affects the 6.5.x(LTS) versions.
sig/sql-infra
SIG: SQL Infra
type/enhancement
The issue or PR belongs to an enhancement.
Enhancement
ref
tidb/server/server.go
Line 737 in 27348d6
Instead of checking all connections in tick(1s) and notifying it to close if the status is not in txn, we can make the connection in func (cc *clientConn) Run(ctx context.Context) to detect if we are going to shutdown and close the connection after executing the ongoing txn.
The current implementation may be hard to close the connection if the connection is actively executing txns.
And there race cases between
ShutdownOrNotify
andclientConn.Run
, like:connStatusDispatching
after reading a "start transaction" statement butsessionVar.InTxn()
is still false.connStatusWaitShutdown
inShutdownOrNotify()
The text was updated successfully, but these errors were encountered: