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

store/tikv: run gc workers parallelly #5837

Merged
merged 15 commits into from
Feb 9, 2018
21 changes: 0 additions & 21 deletions cmd/benchdb/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (

"github.com/pingcap/tidb"
"github.com/pingcap/tidb/store/tikv"
"github.com/pingcap/tidb/store/tikv/gcworker"
"github.com/pingcap/tidb/terror"
"github.com/pingcap/tidb/util/logutil"
log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -79,8 +78,6 @@ func main() {
ut.updateRangeRows(spec)
case "select":
ut.selectRows(spec)
case "gc":
ut.manualGC(nil)
case "query":
ut.query(spec)
default:
Expand Down Expand Up @@ -276,24 +273,6 @@ func (ut *benchDB) selectRows(spec string) {
})
}

// manualGC manually triggers GC and sends to done channel after finished.
func (ut *benchDB) manualGC(done chan bool) {
cLog("GC started")
start := time.Now()
ver, err := ut.store.CurrentVersion()
if err != nil {
log.Fatal(err)
}
err = gcworker.RunGCJob(goctx.Background(), ut.store, ver.Ver, "benchDB")
if err != nil {
log.Fatal(err)
}
cLog("GC finished, duration ", time.Since(start))
if done != nil {
done <- true
}
}

func (ut *benchDB) query(spec string) {
strs := strings.Split(spec, ":")
sql := strs[0]
Expand Down
Loading