internal routing in overlay networks


in Overlay network driver | Docker Docs

it’s said that routing mesh is used for when you connect to “published port”

so here is use case when ports are not published:

lets say I have 2 swarm workers (worker1 and worker2), 2 containers in each in global mode (nginx and mongos), and having overlay network in this setup

the docker-compose schematically is like this:

version: ‘3.3’

image: mongos
mode: global

mode: global

so question is: when I do ping or any other kind of traffic from nginx on worker1 to mongos (using e.g. ping $stackname_mongos) , will the traffic be always routed to mongos on worker1 or there are some chances that it will be routed to mongos container on worker2?

if it will be somehow routed to mongos on worker2 how can I be sure the traffic be always routed to mongos on worker1?