Re: Checksum errors in pg_stat_database

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
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 08:47:37
Message-ID: CAOBaU_bOf26_vmbRLYfD7iYiTFe=EdsPchEZrr6nSx+_oPVcOA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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)

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.

>> 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2019-04-04 09:20:02 Re: [PATCH v20] GSSAPI encryption support
Previous Message Zhenghua Lyu 2019-04-04 08:33:35 Fix rules's command contains for-update