pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: exclusion@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17792: MERGE uses uninitialized pointer and crashes when target tuple is updated concurrently
Date: Wed, 15 Feb 2023 20:42:24 +0100
Message-ID: <20230215194224.egfyt3j5ewy4c6m3@alvherre.pgsql> (raw)
In-Reply-To: <CAEZATCWTFjn6rCx3=NCQhVaRZyi-w=jj8OEmJx9Fb_em5dh4Ew@mail.gmail.com>

On 2023-Feb-15, Dean Rasheed wrote:

> On Tue, 14 Feb 2023 at 19:19, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
> >
> > I agree, this looks to be a good fix.  However, I couldn't in a quick
> > try reproduce the problem, so I haven't been able to verify it.  I'll
> > try to do that early tomorrow.
> 
> I did some more testing, and the fix looks good.

Thank you, I have pushed it.

> > (I also delete the XXX comment there.)
> 
> That makes sense. It's a bit inconsistent (though not related to this
> bug) that a cross-partition update will return OK if the tuple was
> concurrently deleted, so merge will think that it updated the tuple
> and not try an insert action, whereas for a normal update it will try
> an insert action if the tuple was concurrently deleted. The thing that
> seems wrong there is that ExecUpdateAct() sets updateCxt->updated =
> true for a cross-partition update regardless of whether it actually
> executed the insert half of the update/move. In theory, that flag
> could be set to false so that merge would know if the tuple was
> concurrently deleted, though it's not clear if it's worth it.

Hmm.  I wonder if this is just an inconsistency, or rather an outright
bug.

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/





view thread (9+ messages)  latest in thread

Message-ID: <20230215194224.egfyt3j5ewy4c6m3@alvherre.pgsql>
Permalink:  ../20230215194224.egfyt3j5ewy4c6m3@alvherre.pgsql/
Also on:    postgresql.org/message-id/20230215194224.egfyt3j5ewy4c6m3@alvherre.pgsql

 · 

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-bugs@postgresql.org
  Cc: alvherre@alvh.no-ip.org, dean.a.rasheed@gmail.com, exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17792: MERGE uses uninitialized pointer and crashes when target tuple is updated concurrently
  In-Reply-To: <20230215194224.egfyt3j5ewy4c6m3@alvherre.pgsql>

* 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