Re: Checksum errors in pg_stat_database

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Julien Rouhaud <rjuju123(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, David Steele <david(at)pgmasters(dot)net>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Checksum errors in pg_stat_database
Date: 2019-04-04 11:24:56
Message-ID: CABUevEwZi=eEpR8jS+UM8R6F7bxyfOeukSETLnYUe5A=_oPGTg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Apr 4, 2019 at 10:47 AM Julien Rouhaud <rjuju123(at)gmail(dot)com> wrote:

> On Thu, Apr 4, 2019 at 10:25 AM Magnus Hagander <magnus(at)hagander(dot)net>
> wrote:
> >
> > On Thu, Apr 4, 2019 at 6:22 AM Michael Paquier <michael(at)paquier(dot)xyz>
> wrote:
> >>
> >> On Wed, Apr 03, 2019 at 11:56:14AM +0200, Julien Rouhaud wrote:
> >> > But there's still the problem of reporting errors on shared relation,
> >> > so pg_stat_database doesn't really fit for that. If we go with a
> >> > checksum centric view, it'd be strange to have some of the counters in
> >> > another view.
> >>
> >> Having pg_stat_database filled with a phantom row full of NULLs to
> >> track checksum failures of shared objects would be confusing I think.
> >> I personally quite like the separate view approach, with one row per
> >> database, but one opinion does not stand as an agreement.
> >
> > It wouldn't be just that, but it would make sense to include things like
> blks_read/blks_hit there as well, wouldn't it? As well as read/write time.
> Things we don't track today, but it could be useful to do so.
>
> Actually we do track counters for shared relations (see
> pgstat_report_stat), we just don't expose them in any view. But it's
> still possible to get the counters manually:
>
> # select pg_stat_get_db_blocks_hit(0);
> pg_stat_get_db_blocks_hit
> ---------------------------
> 2710329
> (1 row)
>

Oh, right, we do actually collect it, we just don't show is. So that's
another argument *for* having it in pg_stat_database. Or at least not for
having it in a checksum specific view, because then we should really make a
separate view for this as well.

My main concern is that pg_stat_get_db_numbackends(0) report something
> like the total number of backend (though it seems that there's an
> extra connection accounted for, I don't know which process it's), so
> if we expose it in pg_stat_database, sum(numbackends) won't make sense
> anymore.
>

We could also just hardcoded it so that one always shows 0?

>> Anyway, even if we have no agreement on the shape of what we'd like to
> >> do, I don't think that HEAD is in a proper shape now because we just
> >> don't track a portion of the objects which could have checksum
> >> failures. So we should either revert the patch currently committed,
> >> or add tracking for shared objects, but definitely not keep the code
> >> in a state in-between.
> >
> >
> > Definitely. That's why we're discussing it now :) Maybe we should put it
> on the open items list, because we definitely don't want to ship it one way
> and then change our mind in the next version.
>
> I already added an open item for that.
>

Good.

--
Magnus Hagander
Me: https://www.hagander.net/ <http://www.hagander.net/>
Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2019-04-04 11:50:33 Re: [PATCH v20] GSSAPI encryption support
Previous Message Magnus Hagander 2019-04-04 11:19:44 Re: pg_rewind vs superuser