Skip to content

Commit

Permalink
tikv run gc synchronously (#3432)
Browse files Browse the repository at this point in the history
Signed-off-by: xixi <hexilee@juicedata.io>
  • Loading branch information
Hexilee authored and SandyXSD committed Apr 4, 2023
1 parent 3bdef3d commit aacda0b
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions pkg/meta/tkv_tikv.go
Expand Up @@ -310,12 +310,10 @@ func (c *tikvClient) gc() {
if c.gcInterval == 0 {
return
}
go func() {
safePoint, err := c.client.GC(context.Background(), oracle.GoTimeToTS(time.Now().Add(-c.gcInterval)))
if err == nil {
logger.Debugf("TiKV GC returns new safe point: %d (%s)", safePoint, oracle.GetTimeFromTS(safePoint))
} else {
logger.Warnf("TiKV GC: %s", err)
}
}()
safePoint, err := c.client.GC(context.Background(), oracle.GoTimeToTS(time.Now().Add(-c.gcInterval)))
if err == nil {
logger.Debugf("TiKV GC returns new safe point: %d (%s)", safePoint, oracle.GetTimeFromTS(safePoint))
} else {
logger.Warnf("TiKV GC: %s", err)
}
}

0 comments on commit aacda0b

Please sign in to comment.