pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Amit Langote <amitlangote09@gmail.com>
Cc: sbernikov@gmail.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #17055: Logical replication worker crashes when applying update of row that dose not exist in target partiti
Date: Sat, 12 Jun 2021 10:31:35 +0900
Message-ID: <YMQOd4RvCq1ui19U@paquier.xyz> (raw)
In-Reply-To: <2138662.1623460441@sss.pgh.pa.us>
References: <1828113.1623370641@sss.pgh.pa.us>
	<CA+HiwqG05LNWKv=fJDtF93LFmA99KCSZtnAJUAsjBOLFOPy-fA@mail.gmail.com>
	<YMMCFPuQwO6sEcJ+@paquier.xyz>
	<CA+HiwqF0xi2KmPYKPPCtcgQ2vnjQrfm5cdY50VRC+S_s1M4KvQ@mail.gmail.com>
	<1881335.1623423667@sss.pgh.pa.us>
	<2058966.1623442520@sss.pgh.pa.us>
	<YMP+Gx2S8meYYHW4@paquier.xyz>
	<2136546.1623457890@sss.pgh.pa.us>
	<YMQEO1EYRQX1cWGQ@paquier.xyz>
	<2138662.1623460441@sss.pgh.pa.us>

On Fri, Jun 11, 2021 at 09:14:01PM -0400, Tom Lane wrote:
> Perhaps the buildfarm will prove me wrong, but I think we don't
> have to do anything.  And if we did want to do something, what
> would it be?  There is no feedback mechanism to let us observe
> when the worker processed the signal.

I am fine to do nothing here unless the buildfarm says something.

> Oh, I see, you wonder if there could already be entries like these
> in the file.  But since we only turned the log level up for the
> duration of the specific test, it doesn't seem like a problem.

That's not a problem, now.

> (I did think of this to the extent of making sure the second test
> group in 013_partition.pl looks for different messages than the
> first group does.)

Still, the current style is not a pattern I think we should spread
around, as a lot of copy-paste gets done in new tests added and one
would easily mix up queries with pattern checks.  The practice I'd
like to encourage is something like the attached, to make clear that
there is no risk to fetch incorrect logs.
--
Michael

Attachments:

subs-tap-logs.patch (text/x-diff, 1.9K) download diff --git a/src/test/subscription/t/001_rep_changes.pl b/src/test/subscription/t/001_rep_changes.pl index b2fdb289db..abe5efd31d 100644 --- a/src/test/subscription/t/001_rep_changes.pl +++ b/src/test/subscription/t/001_rep_changes.pl @@ -309,6 +309,8 @@ is( $result, qq(1|bar $node_subscriber->append_conf('postgresql.conf', "log_min_messages = debug1"); $node_subscriber->reload; +my $log_location = -s $node_subscriber->logfile; + $node_subscriber->safe_psql('postgres', "DELETE FROM tab_full_pk"); $node_publisher->safe_psql('postgres', @@ -317,7 +319,7 @@ $node_publisher->safe_psql('postgres', "DELETE FROM tab_full_pk WHERE a = 2"); $node_publisher->wait_for_catchup('tap_sub'); -my $logfile = slurp_file($node_subscriber->logfile()); +my $logfile = slurp_file($node_subscriber->logfile, $log_location); ok( $logfile =~ qr/logical replication did not find row to be updated in replication target relation "tab_full_pk"/, 'update target row is missing'); diff --git a/src/test/subscription/t/013_partition.pl b/src/test/subscription/t/013_partition.pl index d0b5a55d18..f309153cf9 100644 --- a/src/test/subscription/t/013_partition.pl +++ b/src/test/subscription/t/013_partition.pl @@ -354,6 +354,8 @@ $node_subscriber1->append_conf('postgresql.conf', "log_min_messages = debug1"); $node_subscriber1->reload; +my $log_location = -s $node_subscriber1->logfile; + $node_publisher->safe_psql('postgres', "INSERT INTO tab1 VALUES (1, 'foo'), (4, 'bar'), (10, 'baz')"); @@ -369,7 +371,7 @@ $node_publisher->safe_psql('postgres', "DELETE FROM tab1"); $node_publisher->wait_for_catchup('sub1'); $node_publisher->wait_for_catchup('sub2'); -my $logfile = slurp_file($node_subscriber1->logfile()); +my $logfile = slurp_file($node_subscriber1->logfile(), $log_location); ok( $logfile =~ qr/logical replication did not find row to be updated in replication target relation's partition "tab1_2_2"/, 'update target row is missing in tab1_2_2');
signature.asc (application/pgp-signature, 832B) download

view thread (17+ messages)  latest in thread

Message-ID: <YMQOd4RvCq1ui19U@paquier.xyz>
Permalink:  ../YMQOd4RvCq1ui19U@paquier.xyz/
Also on:    postgresql.org/message-id/YMQOd4RvCq1ui19U@paquier.xyz

 ·  · 

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: michael@paquier.xyz, tgl@sss.pgh.pa.us, amitlangote09@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17055: Logical replication worker crashes when applying update of row that dose not exist in target partiti
  In-Reply-To: <YMQOd4RvCq1ui19U@paquier.xyz>

* 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