pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Don't try to print data type names in slot_store_error_callback(
8+ messages / 2 participants
[nested] [flat]

* pgsql: Don't try to print data type names in slot_store_error_callback(
@ 2021-07-02 20:05 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 8+ messages in thread

From: Tom Lane @ 2021-07-02 20:05 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't try to print data type names in slot_store_error_callback().

The existing code tried to do syscache lookups in an already-failed
transaction, which is problematic to say the least.  After some
consideration of alternatives, the best fix seems to be to just drop
type names from the error message altogether.  The table and column
names seem like sufficient localization.  If the user is unsure what
types are involved, she can check the local and remote table
definitions.

Having done that, we can also discard the LogicalRepTypMap hash
table, which had no other use.  Arguably, LOGICAL_REP_MSG_TYPE
replication messages are now obsolete as well; but we should
probably keep them in case some other use emerges.  (The complexity
of removing something from the replication protocol would likely
outweigh any savings anyhow.)

Masahiko Sawada and Bharath Rupireddy, per complaint from Andres
Freund.  Back-patch to v10 where this code originated.

Discussion: https://postgr.es/m/20210106020229.ne5xnuu6wlondjpe@alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/50371df266d4c8f4faaf448cbd789d9697443952

Modified Files
--------------
src/backend/replication/logical/relation.c | 105 +----------------------------
src/backend/replication/logical/worker.c   |  32 ++-------
src/include/replication/logicalrelation.h  |   3 -
3 files changed, 6 insertions(+), 134 deletions(-)



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* pgsql: Don't try to print data type names in slot_store_error_callback(
@ 2021-07-02 20:05 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 8+ messages in thread

From: Tom Lane @ 2021-07-02 20:05 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't try to print data type names in slot_store_error_callback().

The existing code tried to do syscache lookups in an already-failed
transaction, which is problematic to say the least.  After some
consideration of alternatives, the best fix seems to be to just drop
type names from the error message altogether.  The table and column
names seem like sufficient localization.  If the user is unsure what
types are involved, she can check the local and remote table
definitions.

Having done that, we can also discard the LogicalRepTypMap hash
table, which had no other use.  Arguably, LOGICAL_REP_MSG_TYPE
replication messages are now obsolete as well; but we should
probably keep them in case some other use emerges.  (The complexity
of removing something from the replication protocol would likely
outweigh any savings anyhow.)

Masahiko Sawada and Bharath Rupireddy, per complaint from Andres
Freund.  Back-patch to v10 where this code originated.

Discussion: https://postgr.es/m/20210106020229.ne5xnuu6wlondjpe@alap3.anarazel.de

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/63a952167092bd2d457691202d71ace943e1b06a

Modified Files
--------------
src/backend/replication/logical/relation.c | 105 +----------------------------
src/backend/replication/logical/worker.c   |  32 ++-------
src/include/replication/logicalrelation.h  |   3 -
3 files changed, 6 insertions(+), 134 deletions(-)



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* pgsql: Don't try to print data type names in slot_store_error_callback(
@ 2021-07-02 20:05 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 8+ messages in thread

From: Tom Lane @ 2021-07-02 20:05 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't try to print data type names in slot_store_error_callback().

The existing code tried to do syscache lookups in an already-failed
transaction, which is problematic to say the least.  After some
consideration of alternatives, the best fix seems to be to just drop
type names from the error message altogether.  The table and column
names seem like sufficient localization.  If the user is unsure what
types are involved, she can check the local and remote table
definitions.

Having done that, we can also discard the LogicalRepTypMap hash
table, which had no other use.  Arguably, LOGICAL_REP_MSG_TYPE
replication messages are now obsolete as well; but we should
probably keep them in case some other use emerges.  (The complexity
of removing something from the replication protocol would likely
outweigh any savings anyhow.)

Masahiko Sawada and Bharath Rupireddy, per complaint from Andres
Freund.  Back-patch to v10 where this code originated.

Discussion: https://postgr.es/m/20210106020229.ne5xnuu6wlondjpe@alap3.anarazel.de

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7fc97752d566735cdab17a4cc4ac3305413ee54e

Modified Files
--------------
src/backend/replication/logical/relation.c | 106 +----------------------------
src/backend/replication/logical/worker.c   |  32 ++-------
src/include/replication/logicalrelation.h  |   3 -
3 files changed, 6 insertions(+), 135 deletions(-)



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* pgsql: Don't try to print data type names in slot_store_error_callback(
@ 2021-07-02 20:05 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 8+ messages in thread

From: Tom Lane @ 2021-07-02 20:05 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't try to print data type names in slot_store_error_callback().

The existing code tried to do syscache lookups in an already-failed
transaction, which is problematic to say the least.  After some
consideration of alternatives, the best fix seems to be to just drop
type names from the error message altogether.  The table and column
names seem like sufficient localization.  If the user is unsure what
types are involved, she can check the local and remote table
definitions.

Having done that, we can also discard the LogicalRepTypMap hash
table, which had no other use.  Arguably, LOGICAL_REP_MSG_TYPE
replication messages are now obsolete as well; but we should
probably keep them in case some other use emerges.  (The complexity
of removing something from the replication protocol would likely
outweigh any savings anyhow.)

Masahiko Sawada and Bharath Rupireddy, per complaint from Andres
Freund.  Back-patch to v10 where this code originated.

Discussion: https://postgr.es/m/20210106020229.ne5xnuu6wlondjpe@alap3.anarazel.de

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/feff6155734e75d9471bb84319afb6f9ca114686

Modified Files
--------------
src/backend/replication/logical/relation.c | 106 +----------------------------
src/backend/replication/logical/worker.c   |  32 ++-------
src/include/replication/logicalrelation.h  |   3 -
3 files changed, 6 insertions(+), 135 deletions(-)



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* pgsql: Don't try to print data type names in slot_store_error_callback(
@ 2021-07-02 20:05 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 8+ messages in thread

From: Tom Lane @ 2021-07-02 20:05 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't try to print data type names in slot_store_error_callback().

The existing code tried to do syscache lookups in an already-failed
transaction, which is problematic to say the least.  After some
consideration of alternatives, the best fix seems to be to just drop
type names from the error message altogether.  The table and column
names seem like sufficient localization.  If the user is unsure what
types are involved, she can check the local and remote table
definitions.

Having done that, we can also discard the LogicalRepTypMap hash
table, which had no other use.  Arguably, LOGICAL_REP_MSG_TYPE
replication messages are now obsolete as well; but we should
probably keep them in case some other use emerges.  (The complexity
of removing something from the replication protocol would likely
outweigh any savings anyhow.)

Masahiko Sawada and Bharath Rupireddy, per complaint from Andres
Freund.  Back-patch to v10 where this code originated.

Discussion: https://postgr.es/m/20210106020229.ne5xnuu6wlondjpe@alap3.anarazel.de

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/32d50b89521786ce9d38bdbcea03f986216c75d3

Modified Files
--------------
src/backend/replication/logical/relation.c | 105 +----------------------------
src/backend/replication/logical/worker.c   |  32 ++-------
src/include/replication/logicalrelation.h  |   3 -
3 files changed, 6 insertions(+), 134 deletions(-)



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* pgsql: Don't try to print data type names in slot_store_error_callback(
@ 2021-07-02 20:05 Tom Lane <tgl@sss.pgh.pa.us>
  2021-07-08 14:57 ` Re: pgsql: Don't try to print data type names in slot_store_error_callback( Robert Haas <robertmhaas@gmail.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Tom Lane @ 2021-07-02 20:05 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't try to print data type names in slot_store_error_callback().

The existing code tried to do syscache lookups in an already-failed
transaction, which is problematic to say the least.  After some
consideration of alternatives, the best fix seems to be to just drop
type names from the error message altogether.  The table and column
names seem like sufficient localization.  If the user is unsure what
types are involved, she can check the local and remote table
definitions.

Having done that, we can also discard the LogicalRepTypMap hash
table, which had no other use.  Arguably, LOGICAL_REP_MSG_TYPE
replication messages are now obsolete as well; but we should
probably keep them in case some other use emerges.  (The complexity
of removing something from the replication protocol would likely
outweigh any savings anyhow.)

Masahiko Sawada and Bharath Rupireddy, per complaint from Andres
Freund.  Back-patch to v10 where this code originated.

Discussion: https://postgr.es/m/20210106020229.ne5xnuu6wlondjpe@alap3.anarazel.de

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0b5089e8c9795cd9611ef5dfee756c97e14cfe75

Modified Files
--------------
src/backend/replication/logical/relation.c | 104 +----------------------------
src/backend/replication/logical/worker.c   |  32 ++-------
src/include/replication/logicalrelation.h  |   3 -
3 files changed, 6 insertions(+), 133 deletions(-)



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: pgsql: Don't try to print data type names in slot_store_error_callback(
  2021-07-02 20:05 pgsql: Don't try to print data type names in slot_store_error_callback( Tom Lane <tgl@sss.pgh.pa.us>
@ 2021-07-08 14:57 ` Robert Haas <robertmhaas@gmail.com>
  2021-07-08 15:21   ` Re: pgsql: Don't try to print data type names in slot_store_error_callback( Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 8+ messages in thread

From: Robert Haas @ 2021-07-08 14:57 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>

On Fri, Jul 2, 2021 at 4:05 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> The existing code tried to do syscache lookups in an already-failed
> transaction, which is problematic to say the least.

Why didn't the assertion in SearchCatCacheInternal() catch this? Was
this code never actually tested?

-- 
Robert Haas
EDB: http://www.enterprisedb.com





^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: pgsql: Don't try to print data type names in slot_store_error_callback(
  2021-07-02 20:05 pgsql: Don't try to print data type names in slot_store_error_callback( Tom Lane <tgl@sss.pgh.pa.us>
  2021-07-08 14:57 ` Re: pgsql: Don't try to print data type names in slot_store_error_callback( Robert Haas <robertmhaas@gmail.com>
@ 2021-07-08 15:21   ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 8+ messages in thread

From: Tom Lane @ 2021-07-08 15:21 UTC (permalink / raw)
  To: Robert Haas <robertmhaas@gmail.com>; +Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>

Robert Haas <robertmhaas@gmail.com> writes:
> On Fri, Jul 2, 2021 at 4:05 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> The existing code tried to do syscache lookups in an already-failed
>> transaction, which is problematic to say the least.

> Why didn't the assertion in SearchCatCacheInternal() catch this? Was
> this code never actually tested?

It wasn't tested under conditions in which a catalog lookup would
be at real risk of failing --- and I'm not sure that we have any
way to do that mechanically.  See discussion downthread about when
a transaction could be considered "failed".

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2021-07-08 15:21 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-07-02 20:05 pgsql: Don't try to print data type names in slot_store_error_callback( Tom Lane <tgl@sss.pgh.pa.us>
2021-07-02 20:05 pgsql: Don't try to print data type names in slot_store_error_callback( Tom Lane <tgl@sss.pgh.pa.us>
2021-07-02 20:05 pgsql: Don't try to print data type names in slot_store_error_callback( Tom Lane <tgl@sss.pgh.pa.us>
2021-07-02 20:05 pgsql: Don't try to print data type names in slot_store_error_callback( Tom Lane <tgl@sss.pgh.pa.us>
2021-07-02 20:05 pgsql: Don't try to print data type names in slot_store_error_callback( Tom Lane <tgl@sss.pgh.pa.us>
2021-07-02 20:05 pgsql: Don't try to print data type names in slot_store_error_callback( Tom Lane <tgl@sss.pgh.pa.us>
2021-07-08 14:57 ` Robert Haas <robertmhaas@gmail.com>
2021-07-08 15:21   ` Tom Lane <tgl@sss.pgh.pa.us>

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