| From: | Nisha Moond <nisha(dot)moond412(at)gmail(dot)com> |
|---|---|
| To: | shveta malik <shveta(dot)malik(at)gmail(dot)com> |
| Cc: | Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, saurabh singh <saurabh(dot)singh214(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Zhijie Hou <houzhijie22(at)gmail(dot)com> |
| Subject: | Re: Proposal: Conflict log history table for Logical Replication |
| Date: | 2026-10-16 14:33:20 |
| Message-ID: | CABdArM5hh6WKL5Ujwq2KYGxMyLPwZDrng61cQ8HSJFRSaYgsbw@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Thu, Oct 15, 2026 at 4:42 PM Nisha Moond <nisha(dot)moond412(at)gmail(dot)com> wrote:
>
> On Thu, Oct 15, 2026 at 3:37 PM shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
> >
> > A few tirival comments for v81:
> >
> > v81-002:
> > 2)
> > drop_subscription.sgml:
> >
> > "If a conflict log table exists for the subscription (that is, when
> > conflict_log_destination is set to table or all), DROP SUBSCRIPTION
> > automatically drops the associated conflict log table. In that case,
> > the subscription cannot be dropped while it has prepared transactions
> > (see two_phase), because they may hold a lock on the conflict log
> > table that is released only when the apply worker applies the
> > corresponding COMMIT PREPARED or ROLLBACK PREPARED. Resolve these
> > transactions first (see pg_prepared_xacts)."
> >
> > Above doc seems misleading. It gives an impression that CLT is dropped
> > while sub can not be dropped in presence of prepared txns.
> >
> > Should we change it to:
> > If conflict_log_destination is set to table or all, the subscription
> > has an associated conflict log table, which DROP SUBSCRIPTION drops
> > along with the subscription. However, DROP SUBSCRIPTION cannot be
> > executed while the subscription has prepared transactions (see
> > two_phase), because such a transaction may hold a lock on the conflict
> > log table that is released only when the apply worker processes the
> > corresponding COMMIT PREPARED or ROLLBACK PREPARED. Resolve these
> > transactions first (see pg_prepared_xacts) before dropping the
> > subscription.
> >
>
> okay agree, your suggestion looks good.
>
> >
> > 3)
> > - "SELECT replica_identity::text FROM $clt_BA WHERE relname = 'tab_temporal';");
> > -is($clt_row_temporal,
> > - '{"id":"[1,2)","valid_at":"{[2020-01-01,2021-01-01)}"}',
> > - 'replica identity uses table column type rather than index opckeytype'
> > + "SELECT replica_identity::text FROM $clt_BA WHERE relname = 'tab_temporal';"
> > );
> > +is( $clt_row_temporal,
> > + '{"id":"[1,2)","valid_at":"{[2020-01-01,2021-01-01)}"}',
> > + 'replica identity uses table column type rather than index opckeytype');
> >
> > Why this change in 002, do we need it?
> >
>
> This formatting change is due to running pgperltidy on the file. It
> should be removed from 002, and pgperltidy should be run on the file
> in 001.
>
> > 4)
> > The test added in 0002 does not cover apply-worker's error in
> > lock_conflictlog_relation(). Is that intentionally left?
> >
>
> No, it was just missed. We can add it.
>
Attached is v82, which addresses the comments on v81:
- 0001: v81-0001 with pgperltidy run on 035_conflicts.pl.
- 0002: fixes for the v81-0002 comments in [1] and [2]
- 0003: fixes for the v81-0001 comments in [2], [3], [4], [5], [6], [7] and [8]
[1] https://www.postgresql.org/message-id/CAFvd2n_io_EdNwvshcSM9-oUZny1spUF%2Bwe1SyMM%3Dw-OYpcH3w%40mail.gmail.com
[2] https://www.postgresql.org/message-id/CAJpy0uALYDzh4%3DdSOdar8DOm%2BE9GPwDxgp-qtyPf_cDQEMsyCA%40mail.gmail.com
[3] https://www.postgresql.org/message-id/CAJpy0uBZyFUtZ5jO9ZpNAu7d-6cYK0tqxMWYts67vmB4%2BXga_Q%40mail.gmail.com
[4] https://www.postgresql.org/message-id/CABdArM45mQrrDg4Oqkw34ZCsH4_ss6naAqWtZeepNyMRxMK33Q%40mail.gmail.com
[5] https://www.postgresql.org/message-id/CAJpy0uC-4L4xUKMzqx%2BeY4UgaDo4g5yG6PpFcVXepVenaYOQ3w%40mail.gmail.com
[6] https://www.postgresql.org/message-id/CABdArM71Xgpc5FXtD7LENStkv9mP0aOqfKHTWBYn0jhdDwbZng%40mail.gmail.com
[7] https://www.postgresql.org/message-id/CAHut%2BPvT4F%3DijMX0RXBYYWqNUc%2BZ37Jb2ZGV2ALLMXLvkp2esQ%40mail.gmail.com
--
Thanks,
Nisha
| Attachment | Content-Type | Size |
|---|---|---|
| v82-0001-Implement-the-conflict-insertion-infrastructure-.patch | application/octet-stream | 95.3 KB |
| v82-0002-Avoid-stalling-apply-on-the-conflict-log-table-w.patch | application/octet-stream | 25.4 KB |
| v82-0003-Address-review-comments-on-v81-0001.patch | application/octet-stream | 14.6 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Nisha Moond | 2026-10-16 14:34:19 | Re: Proposal: Conflict log history table for Logical Replication |
| Previous Message | Ayush Tiwari | 2026-10-16 13:58:13 | Re: Add a pg_wal_preallocate() SQL function to eagerly create future WAL segments |