-
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
ddl: introduce newReorgExprCtx
to replace mock.Context
usage
#53389
Conversation
Hi @lcwangchao. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with 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-sigs/prow repository. |
row := chk.GetRow(0) | ||
if tblInfo.IsCommonHandle { | ||
maxHandle, err = buildCommonHandleFromChunkRow(sessCtx.GetSessionVars().StmtCtx, tblInfo, pkIdx, handleCols, row) | ||
maxHandle, err = buildCommonHandleFromChunkRow(time.UTC, tblInfo, pkIdx, handleCols, row) |
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.
newReorgSessCtx
always returns a location time.UTC
. This replace is equivalent with the old implement
@@ -620,8 +634,7 @@ func buildCommonHandleFromChunkRow(sctx *stmtctx.StatementContext, tblInfo *mode | |||
tablecodec.TruncateIndexValues(tblInfo, idxInfo, datumRow) | |||
|
|||
var handleBytes []byte | |||
handleBytes, err := codec.EncodeKey(sctx.TimeZone(), nil, datumRow...) | |||
err = sctx.HandleError(err) | |||
handleBytes, err := codec.EncodeKey(loc, nil, datumRow...) |
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.
Seems the HandleError takes no effect here because ErrGroupTruncate
is set to LevelError
in sctx.ErrCtx()
. Do we not need HandleError
here
@@ -527,12 +527,12 @@ func loadDDLReorgVars(ctx context.Context, sessPool *sess.Pool) error { | |||
return ddlutil.LoadDDLReorgVars(ctx, sCtx) | |||
} | |||
|
|||
func makeupDecodeColMap(sessCtx sessionctx.Context, dbName model.CIStr, t table.Table) (map[int64]decoder.Column, error) { | |||
func makeupDecodeColMap(dbName model.CIStr, t table.Table) (map[int64]decoder.Column, 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.
Call of makeupDecodeColMap
is writePhysicalTableRecord -> newBackfillScheduler -> newTxnBackfillScheduler -> makeupDecodeColMap
. This is the only call chain. So we can just move the expr ctx construct into makeupDecodeColMap
c13bbb8
to
751bcd1
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #53389 +/- ##
================================================
+ Coverage 74.4881% 74.6156% +0.1275%
================================================
Files 1505 1505
Lines 356677 430246 +73569
================================================
+ Hits 265682 321031 +55349
- Misses 71649 89296 +17647
- Partials 19346 19919 +573
Flags with carried forward coverage won't be shown. Click here to find out more.
|
/test build |
@wuhuizuo: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
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-sigs/prow repository. |
751bcd1
to
7679922
Compare
7679922
to
a6d009c
Compare
/retest |
@lcwangchao: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
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-sigs/prow repository. |
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.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tangenta, YangKeao 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:
Approvers can indicate their approval by writing |
What problem does this PR solve?
Issue Number: ref #53388
Problem Summary:
see issue
What changed and how does it work?
introduce
newReorgExprCtx
to return anExprContext
for DDL reorg phase.newReorgExprCtx
will replacenewReorgSessCtx
when only expr context is required.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.