Commit 1a289cb5 authored by Levin Zimmermann's avatar Levin Zimmermann

lib/mntpt: Insure NEO with > 1 master always returns same mntpt

If a NEO cluster has multiple master nodes, there is no agreed
on order in which the master node addresses appear in the URI.
In order to insure we always get the same mountpoint among different
clients we explicitly sort the master node address order with this
patch.
parent defe973b
...@@ -84,6 +84,12 @@ def _filter_neo(scheme, netloc, path, query, frag): ...@@ -84,6 +84,12 @@ def _filter_neo(scheme, netloc, path, query, frag):
# instance. # instance.
if "@" in netloc: if "@" in netloc:
netloc = netloc[netloc.index("@") + 1 :] netloc = netloc[netloc.index("@") + 1 :]
# Sort multiple master nodes: if a NEO cluster has multiple master
# nodes, there is no agreed on order in which the master node
# addresses appear in the netloc. In order to insure we always
# get the same mountpoint among different clients we explicitly
# sort the master node addr order.
netloc = ",".join(sorted(netloc.split(',')))
return (scheme, netloc, path, query, frag) return (scheme, netloc, path, query, frag)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment