Commit d9d353bc authored by Levin Zimmermann's avatar Levin Zimmermann

lib/zodb: Drop client-only parameters from normalized NEO URI

In NEO/go we changed the NEO URI scheme, so that client-only options
reside in the fragment part of the URI [1]. This means that we should
drop the complete fragment part within normalization in order to ensure
wendelin.core correctly recognizes two different URI pointing to the
same storage.

This hasn't been done in nexedi/wendelin.core!17, because
nexedi/neoppod!18 was still unresolved.

[1] kirr/neo@4c9414ea
parent 885b3556
...@@ -557,6 +557,8 @@ def test_zstor_2zurl(tmpdir, neo_ssl_dict): ...@@ -557,6 +557,8 @@ def test_zstor_2zurl(tmpdir, neo_ssl_dict):
# Different SSL paths # Different SSL paths
("neos://ca=a&key=b&cert=c@xyz:1/cluster", "neos://xyz:1/cluster"), ("neos://ca=a&key=b&cert=c@xyz:1/cluster", "neos://xyz:1/cluster"),
("neos://ca=α&key=β&cert=γ@xyz:1/cluster", "neos://xyz:1/cluster"), ("neos://ca=α&key=β&cert=γ@xyz:1/cluster", "neos://xyz:1/cluster"),
# Client parameters
("neo://127.0.0.1:1234/cluster#compress=True", "neo://127.0.0.1:1234/cluster"),
], ],
) )
def test_zurl_normalize_main(zurl, zurl_norm_ok): def test_zurl_normalize_main(zurl, zurl_norm_ok):
......
...@@ -489,6 +489,9 @@ def _znormalize_neo(scheme, netloc, path, query, frag): ...@@ -489,6 +489,9 @@ def _znormalize_neo(scheme, netloc, path, query, frag):
# get the same mountpoint among different clients we explicitly # get the same mountpoint among different clients we explicitly
# sort the master node addr order. # sort the master node addr order.
netloc = ",".join(sorted(netloc.split(','))) netloc = ",".join(sorted(netloc.split(',')))
# Drop client-only options: they reside in the fragment part
# of the URI, see https://lab.nexedi.com/kirr/neo/commit/4c9414ea
frag = ""
return (scheme, netloc, path, query, frag) return (scheme, netloc, path, query, frag)
_znormalizer('neo', _znormalize_neo) _znormalizer('neo', _znormalize_neo)
_znormalizer('neos', _znormalize_neo) _znormalizer('neos', _znormalize_neo)
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