Skip to content
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

distsql: let analyze use RC level and low priority (#7496) #7500

Merged
merged 1 commit into from
Aug 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions distsql/request_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ func (builder *RequestBuilder) SetAnalyzeRequest(ana *tipb.AnalyzeReq) *RequestB
builder.Request.StartTs = ana.StartTs
builder.Request.Data, builder.err = ana.Marshal()
builder.Request.NotFillCache = true
builder.Request.IsolationLevel = kv.RC
builder.Request.Priority = kv.PriorityLow
return builder
}

Expand Down
6 changes: 3 additions & 3 deletions distsql/request_builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ func (s *testSuite) TestRequestBuilder5(c *C) {
actual, err := (&RequestBuilder{}).SetKeyRanges(keyRanges).
SetAnalyzeRequest(&tipb.AnalyzeReq{}).
SetKeepOrder(true).
SetPriority(kv.PriorityLow).
SetConcurrency(15).
Build()
c.Assert(err, IsNil)
expect := &kv.Request{
Expand All @@ -506,8 +506,8 @@ func (s *testSuite) TestRequestBuilder5(c *C) {
KeyRanges: keyRanges,
KeepOrder: true,
Desc: false,
Concurrency: 0,
IsolationLevel: kv.SI,
Concurrency: 15,
IsolationLevel: kv.RC,
Priority: 1,
NotFillCache: true,
SyncLog: false,
Expand Down
6 changes: 2 additions & 4 deletions executor/analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,8 @@ func (e *AnalyzeIndexExec) open() error {
kvReq, err := builder.SetIndexRanges(e.ctx.GetSessionVars().StmtCtx, e.tblInfo.ID, e.idxInfo.ID, ranger.FullNewRange()).
SetAnalyzeRequest(e.analyzePB).
SetKeepOrder(true).
SetPriority(e.priority).
SetConcurrency(e.concurrency).
Build()
kvReq.Concurrency = e.concurrency
ctx := context.TODO()
e.result, err = distsql.Analyze(ctx, e.ctx.GetClient(), kvReq)
if err != nil {
Expand Down Expand Up @@ -313,9 +312,8 @@ func (e *AnalyzeColumnsExec) buildResp(ranges []*ranger.NewRange) (distsql.Selec
kvReq, err := builder.SetTableRanges(e.tblInfo.ID, ranges, nil).
SetAnalyzeRequest(e.analyzePB).
SetKeepOrder(e.keepOrder).
SetPriority(e.priority).
SetConcurrency(e.concurrency).
Build()
kvReq.Concurrency = e.concurrency
if err != nil {
return nil, errors.Trace(err)
}
Expand Down