Hi Willy,

On Sat, Nov 23, 2013 at 1:38 AM, Willy Tarreau <[email protected]> wrote:

> Hi Pawel,
> On Fri, Nov 22, 2013 at 07:54:18PM -0800, Pawel Veselov wrote:
> > Hi.
> >
> > There has been a heated discussion on this about 2 years back, so sorry
> for
> > reopening any wounds. Also sorry for long winded intro.
> >
> > My understanding is that neither 1.4 nor 1.5 are planned to have any
> > support for resolving any server addresses during normal operations; i.e.
> > such are always resolved at start-up.
> There have been some improvements in this area. The ongoing connection
> rework that's being done for the server-side keep-alive is designed with
> this in mind so that we'll be able to perform DNS resolving during health
> checks and change the server's address on the fly without causing trouble
> to pending connections. Right now the session does not need the server's
> address until one exact instant which is just prior to connecting. And
> this address is immediately copied into the connection and not reused.
> So that is compatible with the ability to change an address on the fly,
> even possibly from the CLI. I find it reasonable to check the DNS for
> each health check since a health check defines the update period you're
> interested in.
>

I see that even 1.4 has sessions that copy addresses from server struct
before connecting.


> This will also help people running in environments like EC2 where
> everything changes each time you sneeze. But that's not done :-)
>

Well, personally, this never been a problem for me, but I stick to VPC.
This particular problem I'm trying to solve comes from using RDS though.

[skipped]

> The problem with connection the application directly to such database is
> > that when the database does go down, previous IP address effectively goes
> > "dark", and I don't even get TCP connections reset on previously
> > established connections.
> That's not exact because you have "on-marked-down shutdown-sessions" for
> this exact purpose.
>

I meant - without ha-proxy.

[skipped]

> Would anybody be interested in an optional parameter address modifier, say
> > "@chk:<n:m>" as a suffix to a host name, to enable ha-proxy to re-check
> the
> > specified name each <n> seconds, past initial resolution? Say, also
> > agreeing to mark server as "down" if a name fails to resolve after <m>
> > checks. If <n> is 0, then no checks are performed past initial
> resolution,
> > which is default and is that now. Having <m> of 0 to mean to not fail on
> > resolution errors.
>
> I'd rather have the DNS servers defined in backends and inherited from
> defaults, so that its possible to specify it once.


Umm, that can prove problematic on systems that have their DNS
change, unless you allow to define a "default" DNS, that is taken from
whatever system configuration there is.


> Also I think your M
> parameter above is more related to the DNS servers themselves and is just
> a cache duration, so I'd put that as one of their settings.


Well, I was more concerned with the address not being resolved at all, than
with not being able to reach DNS server itself. I think it's more
appropriate to be a binary flag, that enables the server to continue
functioning, even its name can not be resolved past TTL of its name entry.


> The N parameter
> should probably be covered by the server's check interval.


Or even just TTL of the name entry.

It will also
> have the benefit of respecting the fastinter and downinter values so that
> we don't resolve DNS too fast when the server is down. I'd also add support
> for preventing the resolving from being made too fast and enforcing the
> cached value to be kept for a configurable amount of time (eg: min-cache).
>

That's what I wanted the N parameter to be, but second thoughts is that
probably unreasonable to have it less than the NS TTL, as no expectation
should be made that the name will change within its TTL.

[skipped]

We wanted to have one of our guys to work on this but everyone's already
> staffed with something else. If someone feels autonomous enough in
> haproxy's lower layers to work on this, that would be great!
>

The biggest roadblock in any of this implementation is apparent lack of
low-level DNS library, one that would provide only (or separately) the
functionality to create/parse requests/responses, and not attempt to do all
that other stuff. Plus, for full compliance you would need DNSSEC, and AAAA
records, at least.

I do find ha-proxy source to be quite transparent and easy to hack into,
but I probably only have resources to just do a simple patch (not so much
for those fancy resolve config sections). I'll start with just adding an
ability to resolve dynamically, using both entry TTL and stick to using the
old address if the resolution starts failing all together. Plus, I'll have
to hack 1.4, since I'm just not ready to move to 1.5 (mostly because of its
current release status).

-- 
With best of best regards
Pawel S. Veselov

Reply via email to