session: make TxnInfo() return even if process info is empty (#57044)#57163
session: make TxnInfo() return even if process info is empty (#57044)#57163ti-chi-bot wants to merge 2 commits intopingcap:release-8.1from
TxnInfo() return even if process info is empty (#57044)#57163Conversation
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
|
This cherry pick PR is for a release branch and has not yet been approved by triage owners. To merge this cherry pick:
DetailsInstructions 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. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@ti-chi-bot: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release-8.1 #57163 +/- ##
================================================
Coverage ? 71.1952%
================================================
Files ? 1466
Lines ? 423291
Branches ? 0
================================================
Hits ? 301363
Misses ? 101422
Partials ? 20506
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This is an automated cherry-pick of #57044
What problem does this PR solve?
Issue Number: close #57043
Problem Summary:
tidb/pkg/session/session.go
Lines 4026 to 4030 in c240fdf
TxnInfo()could be nil if process info is not set(see the implementation ofTxnInfo()). Such sessions are commonly used in DDL/DXF:tidb/pkg/ddl/backfilling_operators.go
Lines 533 to 539 in c240fdf
And they only invoke
session.Begin()before using:tidb/pkg/ddl/index_cop.go
Lines 43 to 48 in c240fdf
As a result, the
startTSfrom internal DDL sessions will not be reported to etcd, and GC safepoint will be advanced unexpectedly.What changed and how does it work?
Make TxnInfo() return even if process info is empty.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.