Skip to content

Commit

Permalink
*: add resource group name when dispatch req to tiflash (#47096)
Browse files Browse the repository at this point in the history
close #47093
  • Loading branch information
guo-shaoge authored Sep 20, 2023
1 parent e8d2223 commit 3f3b07e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions executor/internal/mpp/local_mpp_coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ func (c *localMppCoordinator) appendMPPDispatchReq(pf *plannercore.Fragment) err
CoordinatorAddress: c.coordinatorAddr,
ReportExecutionSummary: c.reportExecutionInfo,
State: kv.MppTaskReady,
ResourceGroupName: c.sessionCtx.GetSessionVars().ResourceGroupName,
}
c.reqMap[req.ID] = &mppRequestReport{mppReq: req, receivedReport: false, errMsg: "", executionSummaries: nil}
c.mppReqs = append(c.mppReqs, req)
Expand Down
1 change: 1 addition & 0 deletions kv/mpp.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ type MPPDispatchRequest struct {
CoordinatorAddress string
ReportExecutionSummary bool
State MppTaskStates
ResourceGroupName string
}

// CancelMPPTasksParam represents parameter for MPPClient's CancelMPPTasks
Expand Down
3 changes: 3 additions & 0 deletions store/copr/batch_coprocessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1276,6 +1276,9 @@ func (b *batchCopIterator) handleTaskOnce(ctx context.Context, bo *backoff.Backo
RecordTimeStat: true,
RecordScanStat: true,
TaskId: b.req.TaskID,
ResourceControlContext: &kvrpcpb.ResourceControlContext{
ResourceGroupName: b.req.ResourceGroupName,
},
})
if b.req.ResourceGroupTagger != nil {
b.req.ResourceGroupTagger(req)
Expand Down
1 change: 1 addition & 0 deletions store/copr/mpp.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ func (c *MPPClient) DispatchMPPTask(param kv.DispatchMPPTaskParam) (resp *mpp.Di
CoordinatorAddress: req.CoordinatorAddress,
ReportExecutionSummary: req.ReportExecutionSummary,
MppVersion: req.MppVersion.ToInt64(),
ResourceGroupName: req.ResourceGroupName,
}

mppReq := &mpp.DispatchTaskRequest{
Expand Down

0 comments on commit 3f3b07e

Please sign in to comment.