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

From: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
To: Salma El-Sayed <salmasayed182003(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>, Kirill Reshke <reshkekirill(at)gmail(dot)com>
Subject: Re: PoC: Simplify recovery after dropping a table by LOGGING the restore LSN
Date: 2026-10-15 21:25:37
Message-ID: CAN4CZFOVE8gUQH_SO65cFU1U7M=wu4+778UD_4S1C=hhi6RLtA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

drop_lsn = GetXLogInsertRecPtr();
-
+ RegisterDropDatabaseLog(db_id, dbname, drop_lsn, already_invalid);
+ }

...

+ if (!dropdb_callback_registered)
+ {
+ RegisterXactCallback(DropDbXactCallback, NULL);

If a backend crashes between them the callback doesn't run and we are
left with an invalid database without logging it.

You can reproduce this by stopping the drop at the
'dropdb-after-invalid-marker' injection point and killing the backend.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2026-10-15 21:36:41 Re: [PATCH 0/2] Improve ndistinct estimates for flattened UNION ALL
Previous Message Sami Imseih 2026-10-15 21:21:03 Re: [PATCH] Doc fix for autovacuum_max_parallel_workers