Skip to content

Commit

Permalink
Merge branch 'release-4.0' into release-4.0-9ac5b7ae3669
Browse files Browse the repository at this point in the history
  • Loading branch information
eurekaka authored Mar 8, 2021
2 parents ac11792 + a7199ff commit 4b315b1
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 13 deletions.
4 changes: 4 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
component/executor:
- distsql/*
- executor/*
- !executor/brie*
- util/chunk/*
- util/disk/*
- util/execdetails/*
Expand Down Expand Up @@ -31,3 +32,6 @@ component/DDL:

component/config:
- config/*

sig/migrate:
- executor/brie*
5 changes: 5 additions & 0 deletions executor/brie.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import (
"github.com/pingcap/tidb/sessionctx/variable"
"github.com/pingcap/tidb/types"
"github.com/pingcap/tidb/util/chunk"
"github.com/pingcap/tidb/util/printer"
"github.com/pingcap/tidb/util/sqlexec"
)

Expand Down Expand Up @@ -465,3 +466,7 @@ func (gs *tidbGlueSession) Record(name string, value uint64) {
gs.info.archiveSize = value
}
}

func (gs *tidbGlueSession) GetVersion() string {
return "TiDB\n" + printer.GetTiDBInfo()
}
28 changes: 28 additions & 0 deletions executor/brie_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright 2021 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.

package executor

import . "github.com/pingcap/check"

type testBRIESuite struct{}

var _ = Suite(&testBRIESuite{})

func (s *testBRIESuite) TestGlueGetVersion(c *C) {
g := tidbGlueSession{}
version := g.GetVersion()
c.Assert(version, Matches, `(.|\n)*Release Version(.|\n)*`)
c.Assert(version, Matches, `(.|\n)*Git Commit Hash(.|\n)*`)
c.Assert(version, Matches, `(.|\n)*GoVersion(.|\n)*`)
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ require (
github.com/pingcap/failpoint v0.0.0-20200702092429-9f69995143ce
github.com/pingcap/fn v0.0.0-20200306044125-d5540d389059
github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989
github.com/pingcap/kvproto v0.0.0-20201126113434-70db5fb4b0dc
github.com/pingcap/kvproto v0.0.0-20210308075244-560097d1309b
github.com/pingcap/log v0.0.0-20201112100606-8f1e84a3abc8
github.com/pingcap/parser v0.0.0-20210303062609-d1d977c9ceed
github.com/pingcap/sysutil v0.0.0-20201130064824-f0c8aa6a6966
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,8 @@ github.com/pingcap/kvproto v0.0.0-20191211054548-3c6b38ea5107/go.mod h1:WWLmULLO
github.com/pingcap/kvproto v0.0.0-20200411081810-b85805c9476c/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI=
github.com/pingcap/kvproto v0.0.0-20200907074027-32a3a0accf7d h1:gvJScINTd/HFasp82W1paGTfbYe2Bnzn8QBOJXckLwY=
github.com/pingcap/kvproto v0.0.0-20200907074027-32a3a0accf7d/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI=
github.com/pingcap/kvproto v0.0.0-20201126113434-70db5fb4b0dc h1:BtszN3YR5EScxiGGTD3tAf4CQE90bczkOY0lLa07EJA=
github.com/pingcap/kvproto v0.0.0-20201126113434-70db5fb4b0dc/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI=
github.com/pingcap/kvproto v0.0.0-20210308075244-560097d1309b h1:Jp0V5PDzdOy666n4XbDDaEjOKHsp2nk7b2uR6qjFI0s=
github.com/pingcap/kvproto v0.0.0-20210308075244-560097d1309b/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI=
github.com/pingcap/log v0.0.0-20191012051959-b742a5d432e9/go.mod h1:4rbK1p9ILyIfb6hU7OG2CiWSqMXnp3JMbiaVJ6mvoY8=
github.com/pingcap/log v0.0.0-20200117041106-d28c14d3b1cd/go.mod h1:4rbK1p9ILyIfb6hU7OG2CiWSqMXnp3JMbiaVJ6mvoY8=
github.com/pingcap/log v0.0.0-20200511115504-543df19646ad/go.mod h1:4rbK1p9ILyIfb6hU7OG2CiWSqMXnp3JMbiaVJ6mvoY8=
Expand Down
4 changes: 2 additions & 2 deletions store/tikv/batch_coprocessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ func (b *batchCopIterator) handleTaskOnce(ctx context.Context, bo *Backoffer, ta
IsolationLevel: pbIsolationLevel(b.req.IsolationLevel),
Priority: kvPriorityToCommandPri(b.req.Priority),
NotFillCache: b.req.NotFillCache,
HandleTime: true,
ScanDetail: true,
RecordTimeStat: true,
RecordScanStat: true,
TaskId: b.req.TaskID,
})
req.StoreTp = kv.TiFlash
Expand Down
16 changes: 8 additions & 8 deletions store/tikv/coprocessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -872,8 +872,8 @@ func (worker *copIteratorWorker) handleTaskOnce(bo *Backoffer, task *copTask, ch
IsolationLevel: pbIsolationLevel(worker.req.IsolationLevel),
Priority: kvPriorityToCommandPri(worker.req.Priority),
NotFillCache: worker.req.NotFillCache,
HandleTime: true,
ScanDetail: true,
RecordTimeStat: true,
RecordScanStat: true,
TaskId: worker.req.TaskID,
})
req.StoreTp = task.storeType
Expand Down Expand Up @@ -1013,9 +1013,9 @@ func (worker *copIteratorWorker) logTimeCopTask(costTime time.Duration, task *co
}
}

if detail != nil && detail.HandleTime != nil {
processMs := detail.HandleTime.ProcessMs
waitMs := detail.HandleTime.WaitMs
if detail != nil && detail.TimeDetail != nil {
processMs := detail.TimeDetail.ProcessWallTimeMs
waitMs := detail.TimeDetail.WaitWallTimeMs
if processMs > minLogKVProcessTime {
logStr += fmt.Sprintf(" kv_process_ms:%d", processMs)
if detail.ScanDetail != nil {
Expand Down Expand Up @@ -1150,9 +1150,9 @@ func (worker *copIteratorWorker) handleCopResponse(bo *Backoffer, rpcCtx *RPCCon
}
resp.respTime = costTime
if pbDetails := resp.pbResp.ExecDetails; pbDetails != nil {
if handleTime := pbDetails.HandleTime; handleTime != nil {
resp.detail.WaitTime = time.Duration(handleTime.WaitMs) * time.Millisecond
resp.detail.ProcessTime = time.Duration(handleTime.ProcessMs) * time.Millisecond
if timeDetail := pbDetails.TimeDetail; timeDetail != nil {
resp.detail.WaitTime = time.Duration(timeDetail.WaitWallTimeMs) * time.Millisecond
resp.detail.ProcessTime = time.Duration(timeDetail.ProcessWallTimeMs) * time.Millisecond
}
if scanDetail := pbDetails.ScanDetail; scanDetail != nil {
if scanDetail.Write != nil {
Expand Down

0 comments on commit 4b315b1

Please sign in to comment.