pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: craig@2ndquadrant.com
Cc: pgsql-hackers@postgresql.org
Subject: Re: xact_start for walsender & logical decoding not updated
Date: Sun, 29 Dec 2019 00:34:33 +0100
Message-ID: <20191228233433.gi3er4mvdghia64v@development> (raw)
In-Reply-To: <20191227194618.GA30125@alvherre.pgsql>
References: <20191213.150124.69303805839083319.horikyota.ntt@gmail.com>
	<20191227194618.GA30125@alvherre.pgsql>

On Fri, Dec 27, 2019 at 04:46:18PM -0300, Alvaro Herrera wrote:
>On 2019-Dec-13, Kyotaro Horiguchi wrote:
>
>> At Fri, 13 Dec 2019 13:05:41 +0800, Craig Ringer <craig@2ndquadrant.com> wrote in
>> > On Wed, 11 Dec 2019 at 02:08, Alvaro Herrera <alvherre@2ndquadrant.com>
>> > wrote:
>> >
>> > > On 2019-Dec-10, Tomas Vondra wrote:
>> > >
>> > > > On Tue, Dec 10, 2019 at 09:42:17AM +0900, Kyotaro Horiguchi wrote:
>> > > > > At Tue, 10 Dec 2019 00:44:09 +0100, Tomas Vondra <
>> > > tomas.vondra@2ndquadrant.com> wrote in
>> > >
>> > > > > I'm not sure how much xact_start for walsender is useful and we really
>> > > > > is not running a statement there.  Also autovac launcher starts
>> > > > > transaction without a valid statement timestamp perhaps for the same
>> > > > > reason.
>> > > >
>> > > > Maybe, but then maybe we should change it so that we don't report any
>> > > > timestamps for such processes.
>> > >
>> > > Yeah, I think we should to that.
>> > Agreed. Don't report a transaction start timestamp at all if we're not in a
>> > read/write txn in the walsender, which we should never be when using a
>> > historic snapshot.
>> >
>> > It's not interesting or relevant.
>
>This patch changes xact.c to avoid updating transaction start timestamps
>for walsenders (maybe more commentary is desirable).  I think logical
>decoding is just a special form of walsender and thus it would also be
>updated by this patch, unless I misunderstood what Tomas explained.
>

It's true walsender should not be doing any read-write transactions or
executing statements (well, maybe a decoding plugin could, but using
historic snapshot).

So I agree not leaving xact_start for walsender processes seems OK.

>> > Reporting the commit timestamp of the current or last-processed xact would
>> > likely just be confusing. I'd rather see that in pg_stat_replication if
>> > we're going to show it, that way we can label it usefully.
>>
>> Sounds reasonable.
>
>Developers interested in this feature can submit a patch, as usual :-)
>

;-)


regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services 





view thread (18+ messages)  latest in thread

Message-ID: <20191228233433.gi3er4mvdghia64v@development>
Permalink:  ../20191228233433.gi3er4mvdghia64v@development/
Also on:    postgresql.org/message-id/20191228233433.gi3er4mvdghia64v@development

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tomas.vondra@2ndquadrant.com, alvherre@2ndquadrant.com, horikyota.ntt@gmail.com, craig@2ndquadrant.com
  Subject: Re: xact_start for walsender & logical decoding not updated
  In-Reply-To: <20191228233433.gi3er4mvdghia64v@development>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox