Skip to content

Commit

Permalink
This is an automated cherry-pick of pingcap#57299
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
  • Loading branch information
3pointer authored and ti-chi-bot committed Nov 22, 2024
1 parent d2978bc commit f9dd9e5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions br/pkg/streamhelper/basic_lib_for_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,14 @@ func (t *testEnv) putTask() {
}

func (t *testEnv) ScanLocksInOneRegion(bo *tikv.Backoffer, key []byte, maxVersion uint64, limit uint32) ([]*txnlock.Lock, *tikv.KeyLocation, error) {
<<<<<<< HEAD
=======
t.mu.Lock()
defer t.mu.Unlock()
if t.maxTs != maxVersion {
return nil, nil, errors.Errorf("unexpect max version in scan lock, expected %d, actual %d", t.maxTs, maxVersion)
}
>>>>>>> 6528da5f400 (test: fix data race in scan locks (#57299))
for _, r := range t.regions {
if len(r.locks) != 0 {
return r.locks, &tikv.KeyLocation{
Expand All @@ -784,6 +792,8 @@ func (t *testEnv) ScanLocksInOneRegion(bo *tikv.Backoffer, key []byte, maxVersio
}

func (t *testEnv) ResolveLocksInOneRegion(bo *tikv.Backoffer, locks []*txnlock.Lock, loc *tikv.KeyLocation) (*tikv.KeyLocation, error) {
t.mu.Lock()
defer t.mu.Unlock()
for _, r := range t.regions {
if loc != nil && loc.Region.GetID() == r.id {
// reset locks
Expand Down

0 comments on commit f9dd9e5

Please sign in to comment.