| From: | Imran Zaheer <imran(dot)zhir(at)gmail(dot)com> |
|---|---|
| To: | shveta malik <shveta(dot)malik(at)gmail(dot)com> |
| Cc: | Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, shveta malik <shvetamalik(at)gmail(dot)com> |
| Subject: | Re: effective_wal_level is not decreasing after using REPACK (CONCURRENTLY) |
| Date: | 2026-05-26 09:39:29 |
| Message-ID: | CA+UBfa=E_zbZzr5r_hV6rLiYjA0KQhUgTquXVPKKoyKS=Mnh2w@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi,
Thanks Shveta, I agree with the additional sanity checks and comments.
Here is the updated patch.
Thanks
Imran Zaheer
On Mon, May 25, 2026 at 9:11 AM shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
>
> On Sat, May 23, 2026 at 2:49 PM Imran Zaheer <imran(dot)zhir(at)gmail(dot)com> wrote:
> >
> > Hi
> >
> > Thanks for the review. In the attached patch, I added an argument that
> > will help explicitly control whether to stop logical decoding or not.
> >
> > -ReplicationSlotDropAcquired(void)
> > +ReplicationSlotDropAcquired(bool disable_logical_decoding)
> >
> > I hope this will be enough to make the caller intent more explicit and
> > will prevent future omissions like this.
> >
>
> Overall it looks good. I have a few trivial comments; please
> incorporate them if you agree.
>
> 1)
> +ReplicationSlotDropAcquired(bool disable_logical_decoding)
>
> We can change comments atop this function. Suggestion :
>
> /*
> * Permanently drop the currently acquired replication slot and
> * request the checkpointer to disable logical decoding if requested
> * by the caller.
> */
>
>
> 2)
> Additionally I think it will be good to have below sanity check in
> ReplicationSlotDropAcquired(). Thoughts?
>
> /* Ensure that slot is logical if caller has requested to disable
> logical decoding */
> Assert(!disable_logical_decoding || SlotIsLogical(MyReplicationSlot));
>
> 3)
> @@ -567,7 +567,7 @@ drop_local_obsolete_slots(List *remote_slot_list)
> if (synced_slot)
> {
> ReplicationSlotAcquire(NameStr(local_slot->data.name), true, false);
> - ReplicationSlotDropAcquired();
> + ReplicationSlotDropAcquired(false);
> }
>
> Since it is a logical slot and we are still passing false, we may add
> a comment. Suggestion:
>
> /*
> * We don't want to disable logical decoding during slot drop on the
> * physical standby, since the standby derives the logical decoding
> * state from the upstream server in the replication chain.
> */
>
> thanks
> Shveta
| Attachment | Content-Type | Size |
|---|---|---|
| v3-0001-Disable-logical-decoding-after-REPACK-CONCURRENTL.patch | text/x-patch | 6.7 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Jim Jones | 2026-05-26 09:46:44 | Re: [PATCH] Add CANONICAL option to xmlserialize |
| Previous Message | shveta malik | 2026-05-26 09:38:19 | Re: Proposal: Conflict log history table for Logical Replication |