415
res *matchingservice.DescribeTaskQueuePartitionResponse,
416
info *taskqueuespb.PartitionScaleInfo,
418
>
// Require that the partition agrees with the current scale state, i.e. it knows that
419
>
// it's draining, i.e. it knows it can't accept any new tasks. We include the version
420
>
// as well as just the read+write counts to avoid an ABA problem.
421
>
resInfo := res.GetScaleInfo()
422
>
if resInfo == nil ||
423
>
resInfo.Version != info.Version ||
424
>
resInfo.Read != info.Read ||
425
>
resInfo.Write != info.Write {
426
return false
427
}
428
430
>
for _, q := range v.GetPhysicalTaskQueueInfo().GetInternalTaskQueueStatus() {
431
>
if !q.GetBacklogDrained() {
432
return false
433
}