Re: [PATCH] Report changes discarded for relations not in the subscription

From: Hüseyin Demir <huseyin(dot)d3r(at)gmail(dot)com>
To: Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] Report changes discarded for relations not in the subscription
Date: 2026-12-01 16:16:11
Message-ID: CAB5wL7YVUSkzriCAcZmFJ_LwYBD=589fuL4o0hdjXacVA7uQCg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Peter,

Thanks for the review. v5 is attached. It changes only the tests.

> 1.
> It seemed odd to me to for tests of LOG and DETAIL to be separated
> when really they belong to the same ereport.

Agreed. v5 checks both with a single wait_for_log() regex, the same
".*\n.*DETAIL:" style that 013_partition.pl and 029_on_error.pl use.

> 2.
> How about:
> Subsequent changes will be skipped again, so must be reported again.

Done.

> 3.
> I wonder if it's more readable to not have that loop, and simply do:
>
> $node_publisher->safe_psql('postgres', qq(
> INSERT INTO test_tab_3 SELECT * FROM generate_series(1, 5000);
> INSERT INTO test_tab_3 SELECT * FROM generate_series(1, 5000);
> INSERT INTO test_tab_3 SELECT * FROM generate_series(1, 5000);
> ));

I'd prefer to keep the loop. The point of this test is that there are
three separate streamed transactions, each sending the RELATION message
again. The loop makes it explicit that each INSERT is its own
safe_psql() call and so its own transaction. A single script relies on
psql's autocommit to split it into three transactions, and that's less
obvious to the reader. The result is the same either way, so I can change
it if you feel strongly.

> 4.
> My LLM interpreted that as below. Is it what was meant?

Yes, that is what was meant. I used your wording.

> 5.
> (Here is similar to earlier review comment. IMO i might be better to
> combine these since both are emitted by the same ereport)

Done, same as #1.

Regards,
Demir.

Attachment Content-Type Size
v5-0001-log-unapplied-changes-for-non-ready-relations.patch application/octet-stream 15.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Narayanan Venkateswaran 2026-12-01 16:18:51 Re: Fix LogStandbySnapshot() race during logical decoding activation
Previous Message Fujii Masao 2026-12-01 15:52:40 Re: EXPLAIN ANALYZE CREATE TABLE AS EXECUTE runs non-SELECT prepared statements