pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Lakhin <exclusion@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
To: jian he <jian.universality@gmail.com>
Cc: Ajin Cherian <itsajin@gmail.com>
Cc: Jim Jones <jim.jones@uni-muenster.de>
Cc: Garrett Thornburg <film42@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: PATCH: Add REINDEX tag to event triggers
Date: Wed, 6 Dec 2023 10:00:01 +0300
Message-ID: <b95c51d5-6089-f8ee-dcfc-94b620b21ff3@gmail.com> (raw)
In-Reply-To: <ZW5kf4WOaZOJMgls@paquier.xyz>
References: <CACJufxGjd+Za5wnvRnnFXnPz=mtc2ZU_pRknoQKxvCAisFMMsA@mail.gmail.com>
	<ZVsL84PYe-LoBGQx@paquier.xyz>
	<CACJufxH+0KHWT19qfyP1VM3h8+CGH7t4LxaLrSA7Lhecs6ia1Q@mail.gmail.com>
	<ZWAN7v-foi6FEgO3@paquier.xyz>
	<CACJufxGOJM6mfk1Zf0GzSLJ+-PTfi=daw1oa2kRqzeKxp+Zbtg@mail.gmail.com>
	<CAFPTHDZ=Ge4pFxxpQZfgLhMimon7EWeZsrxsa=vyPraTZ+Hb2g@mail.gmail.com>
	<CACJufxFPTWsdNj=XLnuBuf=J68NAHPNn7C0uQodzPHYQ=h=Lnw@mail.gmail.com>
	<ZW0ltJXJ2Aigvizl@paquier.xyz>
	<cb538743-484c-eb6a-a8c5-359980cd3a17@gmail.com>
	<CACJufxEYKDAzbPchzeDJKTHpHFDNw_--uDrwM5hw-CeLRhspOw@mail.gmail.com>
	<ZW5kf4WOaZOJMgls@paquier.xyz>

Hi Michael,

05.12.2023 02:45, Michael Paquier wrote:
> Popping a snapshot at this stage when there are no indexes has been a
> decision taken by the original commit in 5dc92b844e68 because we had
> no need for it yet, but we may do now depending on the function
> triggered.  I have been looking at the whole stack and something like
> the attached to make a pop conditional seems to be sufficient to
> satisfy all the cases I've been able to come up with, including the
> one reported here.
>
> Alexander, do you see any hole in that?  Perhaps the snapshot push
> should be more aggressive at the end of ReindexRelationConcurrently()
> as well (in the last transaction when rebuilds happen)?

Thank you for the fix proposed!

I agree with it. I had worried a bit about ReindexRelationConcurrently()
becoming twofold for callers (it can leave the snapshot or pop it), but I
couldn't find a way to hide this twofoldness inside without adding more
complexity. On the other hand, ReindexRelationConcurrently() now satisfies
EnsurePortalSnapshotExists() in all cases.

Best regards,
Alexander





view thread (27+ messages)  latest in thread

Message-ID: <b95c51d5-6089-f8ee-dcfc-94b620b21ff3@gmail.com>
Permalink:  ../b95c51d5-6089-f8ee-dcfc-94b620b21ff3@gmail.com/
Also on:    postgresql.org/message-id/b95c51d5-6089-f8ee-dcfc-94b620b21ff3@gmail.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: exclusion@gmail.com, michael@paquier.xyz, jian.universality@gmail.com, itsajin@gmail.com, jim.jones@uni-muenster.de, film42@gmail.com
  Subject: Re: PATCH: Add REINDEX tag to event triggers
  In-Reply-To: <b95c51d5-6089-f8ee-dcfc-94b620b21ff3@gmail.com>
  References: <CACJufxGjd+Za5wnvRnnFXnPz=mtc2ZU_pRknoQKxvCAisFMMsA@mail.gmail.com> <ZVsL84PYe-LoBGQx@paquier.xyz> <CACJufxH+0KHWT19qfyP1VM3h8+CGH7t4LxaLrSA7Lhecs6ia1Q@mail.gmail.com> <ZWAN7v-foi6FEgO3@paquier.xyz> <CACJufxGOJM6mfk1Zf0GzSLJ+-PTfi=daw1oa2kRqzeKxp+Zbtg@mail.gmail.com> <CAFPTHDZ=Ge4pFxxpQZfgLhMimon7EWeZsrxsa=vyPraTZ+Hb2g@mail.gmail.com> <CACJufxFPTWsdNj=XLnuBuf=J68NAHPNn7C0uQodzPHYQ=h=Lnw@mail.gmail.com> <ZW0ltJXJ2Aigvizl@paquier.xyz> <cb538743-484c-eb6a-a8c5-359980cd3a17@gmail.com> <CACJufxEYKDAzbPchzeDJKTHpHFDNw_--uDrwM5hw-CeLRhspOw@mail.gmail.com> <ZW5kf4WOaZOJMgls@paquier.xyz> <b95c51d5-6089-f8ee-dcfc-94b620b21ff3@gmail.com>

* 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