Re: PoC: Simplify recovery after dropping a table by LOGGING the restore LSN

From: Salma Elsayed <salmasayed182003(at)gmail(dot)com>
To: "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>
Cc: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>, pgsql-hackers mailing list <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Kirk Wolak <wolakk(at)gmail(dot)com>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Kirill Reshke <reshkekirill(at)gmail(dot)com>, Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com>
Subject: Re: PoC: Simplify recovery after dropping a table by LOGGING the restore LSN
Date: 2026-11-23 10:27:43
Message-ID: CANBEAPE9WT4xKKx-6amA6U-3K7_CpSsihG1LLFKs1ZYvurLK6g@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

I renamed the GUC to log_table_recovery_lsn, since it only covers
tables and it also covers TRUNCATE. I am open to a better name.

On Sun, Nov 8, 2026 at 8:58 AM Andrey M. Borodin <x4mmm(at)yandex-team(dot)ru> wrote:
>
> Hi Salma,
>
> The default text-log prefix has no database name. IDK, users might want
> it: if you do a lot of CREATE DATABASE ... TEMPLATE ... table names and
> oids are same all the way.
>

Thanks for the review. I added the database name to the log message:

LOG: table "public.orders" (OID 16389) in database "shop_a" dropped
at LSN 0/02813958
LOG: table "public.orders" (OID 16389) in database "shop_b" dropped
at LSN 0/02817300

Let me know if this looks like the right way to add it.

> I tried Zsolt's SyncRep scenario with v13. Both messages were already
> logged as expected. What do you think about adding a TAP check for the
> message while the backend still waits in SyncRep?
> I'm not convinced we need it, I don't foresee what kind of bugs could
> hide there in future. Just raising the question about this tests.
>

I added a small test that checks the message is already in the log
while the backend waits in SyncRep. It fails if the logging is moved
after the wait. If you think it is not worth keeping, I am okay with
that.

v14 is attached.

Thanks,
Salma Elsayed

Attachment Content-Type Size
v14-0001-Log-the-recovery-LSN-of-dropped-and-truncated-ta.patch text/x-patch 32.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message wenhui qiu 2026-11-23 10:27:52 Re: Simplify the uniqueness proof for self-join elimination
Previous Message vignesh C 2026-11-23 10:21:49 Re: [PATCH] Check domain constraints for NULLs in logical replication