Re: backend/director admin states

2018-05-03 Thread Geoff Simmons
On 05/03/2018 10:49 AM, Dridi Boukelmoune wrote:
>> Illustrated example: varnishadm backend.list output
>>
>> Backend name  Admin Probe  Last change
>> boot.b1   probe 0/8 badWed, 02 May 2018 13:22:10 
>> GMT
>> boot.b2   probe 8/8 good   Wed, 02 May 2018 13:22:10 
>> GMT
>> boot.b3   healthy   1/8 badWed, 02 May 2018 13:22:10 
>> GMT
>> boot.b4   healthy   -  Wed, 02 May 2018 13:22:10 
>> GMT
>> boot.b5   sick  7/8 good   Wed, 02 May 2018 13:22:10 
>> GMT
>> boot.b6   sick  -  Wed, 02 May 2018 13:22:10 
>> GMT
>> boot.b7   disabled  7/8 good   Wed, 02 May 2018 13:22:10 
>> GMT
>> boot.b8   deleted   -  Wed, 02 May 2018 13:22:10 
>> GMT
>> boot.d1   dependent -  Wed, 02 May 2018 13:22:10 
>> GMT
>> boot.d2   probe 3/4 good   Wed, 02 May 2018 13:22:10 
>> GMT
> 
> We should make this output a bit more functional if we're going to
> break the output.

[...]

> Example:
> 
>> NameTypeHealthProbeStateCommentLast change
>> boot.www1stdautononegood-Wed, 02 May 2018 
>> 13:22:10 GMT
>> boot.www2stdsicknonebad-Wed, 02 May 2018 
>> 13:22:10 GMT
>> boot.wwwfallbackautoclustergood-Wed, 02 May 2018 
>> 13:22:10 GMT
> 
> The idea is to avoid blanks inside columns (except "last change/updated")
> to make it more friendly to a ny column oriented toollike /bin/sh's `read` or
> awk's fields.

I would also suggest ISO 8601 format for the 'Last change' column, to
make it more easily parseable:

2018-05-02T13:22:10Z

Then every whitespace-separated field corresponds to a data column.


Best,
Geoff
-- 
** * * UPLEX - Nils Goroll Systemoptimierung

Scheffelstraße 32
22301 Hamburg

Tel +49 40 2880 5731
Mob +49 176 636 90917
Fax +49 40 42949753

http://uplex.de



signature.asc
Description: OpenPGP digital signature
___
varnish-dev mailing list
varnish-dev@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev

Re: backend/director admin states

2018-05-03 Thread Poul-Henning Kamp
OK, let me try to explain my mental model of this:

Admin health is owned by the CLI and director implementations do not
get to meddle with it.  (But they do get to see it)

  Admin=sick means sick, no matter what the director implementation thinks.

  Admin=healthy means healthy, --//--

  Admin=??? means "Implementation decides if sick or healthy."

Best proposal for "???" seems to be "auto", even though it is not
entirely on point.

The implementation can control its view of the health two ways

  A) Call VRT_SetHealth() and set it on the director.
 (useful for probes as we know them)

  B) Provide a ->healthy() method which will be asked whenever
 anybody wants to know.
 (useful for selecting directors like rr/fb/rnd/hash)

In the new API, there is a director method called ->list() which
gets called during CLI command 'backend.list' so that UX can reflect
what the implementation actually know as best as possible.

So as I see it:  We need to decide:

   1) Best word for "???" above.

   2) Headers in backend.list

   3) What does H1 backend without probe do for ->list()

   4) What does H1 backend with probe do for ->list()

   5) What do vmod_directors do for ->list()

Poul-Henning


PS: Related stuff:

I'm pondering a "VCL_BACKEND std.resolve_backend(VCL_BACKEND)" to
avoid what seems to me to be a lot of complexity in shard to do
the same?

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
varnish-dev mailing list
varnish-dev@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev


Re: backend/director admin states

2018-05-03 Thread Dridi Boukelmoune
> Best proposal for "???" seems to be "auto", even though it is not
> entirely on point.
>
> The implementation can control its view of the health two ways
>
>   A) Call VRT_SetHealth() and set it on the director.
>  (useful for probes as we know them)
>
>   B) Provide a ->healthy() method which will be asked whenever
>  anybody wants to know.
>  (useful for selecting directors like rr/fb/rnd/hash)

"auto" is what we have today in the CLI, and I don't remember ever
being confused by that when I was only a user. And it seems to
still match your A) and B) cases.

Dridi
___
varnish-dev mailing list
varnish-dev@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev


Re: backend/director admin states

2018-05-03 Thread Poul-Henning Kamp

In message <1401d370-56dd-6006-2b3d-21771650f...@uplex.de>, Geoff Simmons write
s:

>>> Illustrated example: varnishadm backend.list output

We should also think about varnishadm backend.list -j ?

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
varnish-dev mailing list
varnish-dev@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev


Re: backend/director admin states

2018-05-03 Thread Poul-Henning Kamp

In message 

Re: backend/director admin states

2018-05-03 Thread Guillaume Quintard
Yp, that's on my plate. Which is rather large...

-- 
Guillaume Quintard

On Thu, May 3, 2018, 13:04 Poul-Henning Kamp  wrote:

> 
> In message  c5q-zxfqjcu0k...@mail.gmail.com>
> , Guillaume Quintard writes:
>
> >All commands should have a JSON option, I reckon.
>
> Somebody should write more code for it then, I reckon :-)
>
> --
> Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
> p...@freebsd.org | TCP/IP since RFC 956
> FreeBSD committer   | BSD since 4.3-tahoe
> Never attribute to malice what can adequately be explained by incompetence.
>
___
varnish-dev mailing list
varnish-dev@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev

Re: backend/director admin states

2018-05-03 Thread Poul-Henning Kamp

In message 
, Guillaume Quintard writes:

>All commands should have a JSON option, I reckon.

Somebody should write more code for it then, I reckon :-)

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
varnish-dev mailing list
varnish-dev@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev


Re: backend/director admin states

2018-05-03 Thread Dridi Boukelmoune
On Thu, May 3, 2018 at 1:04 PM, Poul-Henning Kamp  wrote:
> 
> In message 
> 
> , Guillaume Quintard writes:
>
>>All commands should have a JSON option, I reckon.
>
> Somebody should write more code for it then, I reckon :-)

Maybe we should do that the other way around? Have all CLI commands
reply with a JSON data structure, and CLI consumers like varnishadm,
varnishtest or varnishd -d be able to output it in plain text (with
this code centralized in libvarnish and exposed in libvarnishapi).

Dridi
___
varnish-dev mailing list
varnish-dev@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev


Re: backend/director admin states

2018-05-03 Thread Guillaume Quintard
All commands should have a JSON option, I reckon.

-- 
Guillaume Quintard

On Thu, May 3, 2018, 12:52 Poul-Henning Kamp  wrote:

> 
> In message <1401d370-56dd-6006-2b3d-21771650f...@uplex.de>, Geoff Simmons
> write
> s:
>
> >>> Illustrated example: varnishadm backend.list output
>
> We should also think about varnishadm backend.list -j ?
>
> --
> Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
> p...@freebsd.org | TCP/IP since RFC 956
> FreeBSD committer   | BSD since 4.3-tahoe
> Never attribute to malice what can adequately be explained by incompetence.
> ___
> varnish-dev mailing list
> varnish-dev@varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
>
___
varnish-dev mailing list
varnish-dev@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev