Commit 385a75e1 authored by Levin Zimmermann's avatar Levin Zimmermann

lib/zodb/zstor_2zurl/NEO: support > 1 master nodes

The old code raised an explicit exception when converting a NEO storage
with > 1 master nodes into a URI. Perhaps the rationale for this exception
was that there isn't any agreed on order of master nodes in a NEO URI,
which means that building a URI from such a storage could potentially
break the invariant that any client which points to the same storage
should result in the same WCFS mountpoint.
With 6f5196fa we can now rely on
WCFS mountpoint calculation to always return the same mountpoint even if
the order of master node addresses differ. Therefore we can drop this
exception and allow WCFS to support NEO clusters with more than one master.
parent 60205e74
......@@ -401,15 +401,17 @@ def zstor_2zurl(zstor):
masterv = app.nm.getMasterList()
if len(masterv) == 0:
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]
master_list = []
for master in masterv:
host, port = master.getAddress()
if _is_ipv6(host):
host = "[%s]" % host
u += "%s:%s" % (host, port)
master_list.append("%s:%s" % (host, port))
u += ",".join(master_list)
u += "/%s" % app.name
return u
......
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