Skip to content

Commit

Permalink
restore async split
Browse files Browse the repository at this point in the history
  • Loading branch information
cfzjywxk committed Nov 18, 2019
1 parent f55cbd0 commit ce0d856
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tikv/region.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,15 +320,15 @@ func (rm *RaftRegionManager) OnSplitRegion(derived *metapb.Region, regions []*me
// Run in another goroutine to avoid deadlock.
// TODO need investigations, make `newRegionCtx` running in another goroutine may lead to that
// regionId corresponding `region` can't be found in `rm.regions`, when calling `OnRoleChange`
{
go func() {
oldRegion.waitParent()
rm.mu.Lock()
for i, region := range regions {
rm.regions[region.Id] = newRegionCtx(region, oldRegion, peers[i].LeaderChecker)
}
rm.mu.Unlock()
oldRegion.refCount.Done()
}
}()
}

func (rm *RaftRegionManager) OnRegionConfChange(ctx *raftstore.PeerEventContext, epoch *metapb.RegionEpoch) {
Expand Down

0 comments on commit ce0d856

Please sign in to comment.