Code review comment for lp:~martin-v/zodb/ipv6

Revision history for this message
Jim Fulton (jim-zope) wrote :

Meta comment: I'm new to IPv6, so if I ask dumb questions or say dumb
things, please be patient. :)

> Re: DNS. Users currently configure DNS names in zrpc clients to contact ZEO
> servers, so I guess there is a rationale for that (i.e. users want to use
> names instead of addresses - in particular with IPv6).

Yup. +1 on supporting names. :)

> Now, if you allow DNS names, the question is what lookups should you do. The
> common approach is to look for both AAAA and A, and process them in the order
> in which the operating system returns them. This is what all client software
> supporting IPv6 does, so it's also what users expect it to do.

Maybe I'm missinterpreting what you mean by "process".

I'd be surprised is "all client software" tried each address returned.
I would expect most client software to simply use an address in bind
or connect and get watever address is prefered for the type of socket
they created.

> So now that we have one or more IPv6 addresses per name, and one or more IPv4
> addresses, which ones should we use? zrpc currently supports connecting to
> multiple addresses simultaneously, and then taking the one that comes back
> first.

It's slightly more complicated, but yeah. :)

> With multiple addresses coming out of DNS, it can speed-up connection
> establishment when they are tried simultaneously.

I'm not sure what you mean here. But yeah, if you're going to do
multiple things, doing them in parallel is generally a good strategy.

> There is also precedence in
> other client software doing this, e.g. Apple Safari. As you might have to test
> each address sequentially, you can just as well do so in parallel.
>
> In addition, it was easier to implement that way. If you think it's
> undesirable, I can try to come up with a way to do them
> sequentially.

I'm not clear on what was easier to implement.

I'll try to guess. :)

I see a number of possible issues that this might try to solve.

1. Given a host name, you have to decide whether to bind or connect
   using a v4 or v6 socket.

2. If multiple machines have the same host name, maybe you want to
   treat them as a high-availability pool and connect to whichever one
   is providing the desired service.

   Is there any other reason why there would be multiple v4 addresses
   or multiple v6 addresses for the same host name. (Leaving aside a
   host having obe v4 address and one v6 address)?

Are these the problems you're trying to solve?

For 1, it would be just as easy to grab the first result from
getaddrinfo.

BTW, the patch for the server always uses a v4 socket if a host name
is given, but perhaps I don't understand how v6 interacts with bind.

For 2, I can see real benefits in giving multiple redundant servers
the same host name.

What I'm worried about having clients connect to the same server more
than once. There are 2 reasons for this:

1. It becomes ambiguous whether a v4 or v6 socket will be used.

2. As I mentioned earlier, the ZEO client connection logic has issues.
   We use ZRS to provide a primary secondary replication scheme.
   We used to have primaries and secondaries listen on the same port
   and apps that wanted writable connections would either reject the
   read-only connections provided by the secondaries, or use read-only
   connections until they found a wriatble connection. In either
   case, we found that sometimes, when clients connected to
   secondaries, they would fail to connect to primaries. We finally
   switched to having primaries and secondaries listen on different
   ports.

Perhaps this is moot because I don't think the patch let's a server
listen on both a v4 and a v6 address at the same time.

« Back to merge proposal