allocator: Batch task updates
allocator: Batch task updates

Currently, the allocators use a separate transaction for each task
update in some cases. Each one of these entails a raft round trip. So if
the orchestrator creates 1000 tasks for a new service, it could take a
long time to move all of them to the allocated state.

This commit changes it to batch these task updates. Instead of updating
a task within its own transaction, changes are always made as part of
procUnallocatedTasksNetwork / procUnallocatedTasksVolume, which are now
triggered on a transaction commit.

Signed-off-by: Aaron Lehmann <8ecfc6017a87905413dcd7d63696a2a4c351b604@docker.com>

Noyan759/swarmkit,runshenzhu/swarmkit,yp-engineering/swarmkit,sungwonh/swarmkit,vasil-yordanov/swarmkit,jlhawn/swarmkit,alyyousuf7/swarmkit,vasil-yordanov/swarmkit,cezarsa/swarmkit,dperny/swarmkit-1,fate-grand-order/swarmkit,yongtang/swarmkit,deljuven/swarmkit,docker/swarmkit,elifa/swarmkit,alyyousuf7/swarmkit,cezarsa/swarmkit,sungwonh/swarmkit,RenaudWasTaken/swarmkit,yp-engineering/swarmkit,allencloud/swarmkit,diogomonica/swarmkit,yongtang/swarmkit,deljuven/swarmkit,AliyunContainerService/swarmkit,runshenzhu/swarmkit,cheyang/swarmkit,allencloud/swarmkit,dperny/swarmkit-1,aaronlehmann/swarmkit,AliyunContainerService/swarmkit,jlhawn/swarmkit,diogomonica/swarmkit,elifa/swarmkit,cheyang/swarmkit,RenaudWasTaken/swarmkit,aaronlehmann/swarmkit,fate-grand-order/swarmkit,Noyan759/swarmkit,docker/swarmkit