Skip to content

Commit

Permalink
Update basic_lib_for_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
3pointer authored Dec 12, 2024
1 parent 8d7d2ce commit d63db01
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions br/pkg/streamhelper/basic_lib_for_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,8 @@ func (t *testEnv) putTask() {
}

func (t *testEnv) ScanLocksInOneRegion(bo *tikv.Backoffer, key []byte, maxVersion uint64, limit uint32) ([]*txnlock.Lock, *tikv.KeyLocation, error) {
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)
}
Expand All @@ -789,6 +791,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 d63db01

Please sign in to comment.