1912
1913
// record total-1 as we won't try to load the root partition.
1915
>
1916
>
for id := int32(1); id < partitions; id++ {
1917
>
go func() {
1918
>
ctx := pm.callerInfoContext(context.Background())
1919
>
resp, err := pm.matchingClient.ForceLoadTaskQueuePartition(ctx, &matchingservice.ForceLoadTaskQueuePartitionRequest{
1920
>
NamespaceId: pm.partition.NamespaceId(),
1921
>
TaskQueuePartition: &taskqueuespb.TaskQueuePartition{
1922
>
TaskQueue: pm.partition.TaskQueue().Name(),
1923
>
TaskQueueType: pm.partition.TaskQueue().TaskType(),
1924
>
PartitionId: &taskqueuespb.TaskQueuePartition_NormalPartitionId{NormalPartitionId: id},
1925
>
},
1926
>
})
1927
>
if err != nil {
1928
pm.logger.Error("failed to load child partition after root partition was loaded", tag.Error(err))
1929
return
1930
}
1931
1933
// For the typical TaskQueue with 4 partitions, there is a 1/4 chance
1934
// that a poller is load balanced to the root partition first.