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

improve region request log for diagnose #1300

Merged
merged 21 commits into from
Apr 29, 2024
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
1 change: 1 addition & 0 deletions integration_tests/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func TestMain(m *testing.M) {
opts := []goleak.Option{
goleak.IgnoreTopFunction("github.com/pingcap/goleveldb/leveldb.(*DB).mpoolDrain"),
goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/txnkv/transaction.keepAlive"), // TODO: fix ttlManager goroutine leak
goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/config/retry.(*Config).createBackoffFn.newBackoffFn.func2"),
crazycs520 marked this conversation as resolved.
Show resolved Hide resolved
}

goleak.VerifyTestMain(m, opts...)
Expand Down
8 changes: 4 additions & 4 deletions integration_tests/snapshot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,13 +303,13 @@ func (s *testSnapshotSuite) TestSnapshotThreadSafe() {

func (s *testSnapshotSuite) TestSnapshotRuntimeStats() {
reqStats := tikv.NewRegionRequestRuntimeStats()
tikv.RecordRegionRequestRuntimeStats(reqStats.Stats, tikvrpc.CmdGet, time.Second)
tikv.RecordRegionRequestRuntimeStats(reqStats.Stats, tikvrpc.CmdGet, time.Millisecond)
reqStats.RecordRPCRuntimeStats(tikvrpc.CmdGet, time.Second)
reqStats.RecordRPCRuntimeStats(tikvrpc.CmdGet, time.Millisecond)
snapshot := s.store.GetSnapshot(0)
runtimeStats := &txnkv.SnapshotRuntimeStats{}
snapshot.SetRuntimeStats(runtimeStats)
snapshot.MergeRegionRequestStats(reqStats.Stats)
snapshot.MergeRegionRequestStats(reqStats.Stats)
snapshot.MergeRegionRequestStats(reqStats)
snapshot.MergeRegionRequestStats(reqStats)
bo := tikv.NewBackofferWithVars(context.Background(), 2000, nil)
err := bo.BackoffWithMaxSleepTxnLockFast(5, errors.New("test"))
s.Nil(err)
Expand Down
Loading
Loading