-
Notifications
You must be signed in to change notification settings - Fork 742
Closed
Labels
type/enhancementThe issue or PR belongs to an enhancement.The issue or PR belongs to an enhancement.
Description
Enhancement Task
pd/pkg/mcs/scheduling/server/grpc_service.go
Lines 291 to 311 in daa23f8
for i := 0; i < int(splitCount); i++ { | |
newRegionID, err := c.AllocID() | |
if err != nil { | |
return nil, errs.ErrSchedulerNotFound.FastGenByArgs() | |
} | |
peerIDs := make([]uint64, len(request.Region.Peers)) | |
for i := 0; i < len(peerIDs); i++ { | |
if peerIDs[i], err = c.AllocID(); err != nil { | |
return nil, err | |
} | |
} | |
recordRegions = append(recordRegions, newRegionID) | |
splitIDs = append(splitIDs, &pdpb.SplitID{ | |
NewRegionId: newRegionID, | |
NewPeerIds: peerIDs, | |
}) | |
log.Info("alloc ids for region split", zap.Uint64("region-id", newRegionID), zap.Uint64s("peer-ids", peerIDs)) | |
} |
For each split request, we need to call AllocID
several times. When there are a large number of split requests, like import data scenarios, it costs too much resources. We can support batch alloc ID to reduce the call times.
Metadata
Metadata
Assignees
Labels
type/enhancementThe issue or PR belongs to an enhancement.The issue or PR belongs to an enhancement.