[PATCH] Prefer exact matches in varnishadm backend.set_health.

Dag Haavi Finstad daghf at varnish-software.com
Fri Oct 24 13:42:35 CEST 2014


Hi

This patch is a fix for bug #1349

backend_find now does an extra traversal of the backend list to see if
there is an exact match for the provided name argument. If ip and/or
port is present, it will also check that these don't disagree with the
configured ip/port of the backend. If no exact match can be found, we
fall back to partial matching.

Example: Consider a VCL with backends named foobar00, foobar0, foobar:

backend.list foobar -> foobar
(old behavior -> foobar00, foobar0, foobar)

backend.list foobar0 -> foobar0
(old behavior -> foobar00, foobar0)

backend.list foo -> foobar00, foobar0, foobar
(old behavior -> same)

Related to this, we should consider a different syntax for the ip/port
specification, as the current one uses ':' as the separator, which
breaks for IPv6. We could go with the square bracket syntax
([::1]:8080) or just use a different separator (::1,8080). Ideas?

-- 
Dag Haavi Finstad
Software Developer | Varnish Software
Mobile: +47 476 64 134
We Make Websites Fly!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Prefer-exact-matches-in-varnishadm-backend.set_healt.patch
Type: text/x-patch
Size: 2924 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20141024/648d0bac/attachment.bin>


More information about the varnish-dev mailing list