Re: Replication slot stats misgivings

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: vignesh C <vignesh21@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>, Masahiko Sawada <sawada.mshk@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>, Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Date: 2021-03-30T05:30:24Z
Lists: pgsql-hackers
Hi,

On 2021-03-30 10:13:29 +0530, vignesh C wrote:
> On Tue, Mar 30, 2021 at 6:28 AM Andres Freund <andres@anarazel.de> wrote:
> > Any chance you could write a tap test exercising a few of these cases?
> 
> I can try to write a patch for this if nobody objects.

Cool!

> > E.g. things like:
> >
> > - create a few slots, drop one of them, shut down, start up, verify
> >   stats are still sane
> > - create a few slots, shut down, manually remove a slot, lower
> >   max_replication_slots, start up
> 
> Here by "manually remove a slot", do you mean to remove the slot
> manually from the pg_replslot folder?

Yep - thereby allowing max_replication_slots after the shutdown/start to
be lower than the number of slots-stats objects.

Greetings,

Andres Freund



Commits

  1. Doc: Update logical decoding stats information.

  2. Fix tests for replication slots stats.

  3. Update replication statistics after every stream/spill.

  4. Fix the computation of slot stats for 'total_bytes'.

  5. Another try to fix the test case added by commit f5fc2f5b23.

  6. Use HTAB for replication slot statistics.

  7. Fix test case added by commit f5fc2f5b23.

  8. Add information of total data processed to replication slot stats.

  9. Use NameData datatype for slotname in stats.