pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeremy Schneider <schnjere@amazon.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: relation OID in ReorderBufferToastReplace error message
Date: Fri, 2 Jul 2021 18:57:37 -0700
Message-ID: <abc2552c-acd0-ecd3-0bd9-1b398be29cbf@amazon.com> (raw)
In-Reply-To: <777837.1625197484@sss.pgh.pa.us>
References: <808ed65b-994c-915a-361c-577f088b837f@amazon.com>
	<772142.1625191000@sss.pgh.pa.us>
	<48B6BE63-FE39-45B8-9AD8-819DAAC5877F@amazon.com>
	<777837.1625197484@sss.pgh.pa.us>

On 7/1/21 20:44, Tom Lane wrote:
> So I think the relation name is what to print here.  That's generally
> what we do, and there's not much argument for this case to be different.

Works for me.  Anything in the error message is quickly and easily
visible to users, without attaching debuggers or decoding WAL. A lot of
PostgreSQL users won't know how to do the advanced troubleshooting, but
knowing the table name might give a clue for better identifying SQL that
might have been related, and could help produce better bug reports to
the mailing lists in the future.

Related to that, I do think it could be useful to backpatch this - we
know that users are hitting this error on older versions.  Even though
it's most likely that the speculative insert decoding memory leak bug
will address the problem, this update still seems low-risk and useful to
me just in the off-chance that someone hits the error again.

> (I'm not unsympathetic to the idea that printing schema names
> would be helpful.  Just that here is not where to start with
> that.  Maybe we could consider sucking in the schema name
> during relcache entry build, and then print from that copy so we
> don't need an additional catalog fetch under error conditions?)

Agreed not to tackle that in this thread; I wouldn't want to slow down
the simple tweak that could be useful.

-Jeremy


diff --git a/src/backend/replication/logical/reorderbuffer.c
b/src/backend/replication/logical/reorderbuffer.c
index b8c5e2a44e..6a3a35d05d 100644
inline patch 1: src/backend/replication/logical/reorderbuffer.c (+0/-0 lines) download inline-1.patch--- a/src/backend/replication/logical/reorderbuffer.c +++ b/src/backend/replication/logical/reorderbuffer.c @@ -4625,8 +4625,8 @@ ReorderBufferToastReplace(ReorderBuffer *rb,
ReorderBufferTXN *txn,         toast_rel = RelationIdGetRelation(relation->rd_rel->reltoastrelid);         if (!RelationIsValid(toast_rel)) -               elog(ERROR, "could not open relation with OID %u", -                        relation->rd_rel->reltoastrelid); +               elog(ERROR, "could not open toast relation with OID %u (base relation \"%s\")", +                        relation->rd_rel->reltoastrelid, relation->rd_rel->relname);         toast_desc = RelationGetDescr(toast_rel); -- Jeremy Schneider Database Engineer Amazon Web Services

view thread (19+ messages)  latest in thread

Message-ID: <abc2552c-acd0-ecd3-0bd9-1b398be29cbf@amazon.com>
Permalink:  ../abc2552c-acd0-ecd3-0bd9-1b398be29cbf@amazon.com/
Also on:    postgresql.org/message-id/abc2552c-acd0-ecd3-0bd9-1b398be29cbf@amazon.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: schnjere@amazon.com, tgl@sss.pgh.pa.us
  Subject: Re: relation OID in ReorderBufferToastReplace error message
  In-Reply-To: <abc2552c-acd0-ecd3-0bd9-1b398be29cbf@amazon.com>
  References: <808ed65b-994c-915a-361c-577f088b837f@amazon.com> <772142.1625191000@sss.pgh.pa.us> <48B6BE63-FE39-45B8-9AD8-819DAAC5877F@amazon.com> <777837.1625197484@sss.pgh.pa.us> <abc2552c-acd0-ecd3-0bd9-1b398be29cbf@amazon.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