Commit 139f9025 authored by Levin Zimmermann's avatar Levin Zimmermann

fix uri > 1 master nodes

parent 63153845
...@@ -401,15 +401,18 @@ def zstor_2zurl(zstor): ...@@ -401,15 +401,18 @@ def zstor_2zurl(zstor):
masterv = app.nm.getMasterList() masterv = app.nm.getMasterList()
if len(masterv) == 0: if len(masterv) == 0:
raise RuntimeError("%r has empty master list" % zstor) raise RuntimeError("%r has empty master list" % zstor)
if len(masterv) > 1:
raise NotImplementedError("NEO client has multiple configured masters: %r" % (masterv,))
master = masterv[0]
host, port = master.getAddress()
if _is_ipv6(host): # XXX: How can we ensure we always preserve the same order of master nodes??
host = "[%s]" % host master_list = []
for master in masterv:
host, port = master.getAddress()
u += "%s:%s" % (host, port) if _is_ipv6(host):
host = "[%s]" % host
master_list.append("%s:%s" % (host, port))
u += ",".join(master_list)
u += "/%s" % app.name u += "/%s" % app.name
return u return u
......
    • master_list needs to be sorted, otherwise WCFS mountpoint isn't repeatable

    • this raises the question, if

      • the NEO URI scheme needs to specify a predefined sorting of master nodes
        • this would need to be applied to slapos instance-wcfs.cfg.in, to NEO/go client URI function, ...
      • OR we adjust _mntpt_4zurl in wcfs/__init__.py to pre-sort master nodes
        • this may be easier, we need to filter URI in wcfs anyway
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