| From: | Michael Paquier <michael(at)paquier(dot)xyz> |
|---|---|
| To: | Sami Imseih <samimseih(at)gmail(dot)com> |
| Cc: | Peter Eisentraut <peter(at)eisentraut(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: [Proposal] Adding callback support for custom statistics kinds |
| Date: | 2026-07-14 08:07:19 |
| Message-ID: | alXuNpt9aqkxCfeK@paquier.xyz |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Mon, Jul 13, 2026 at 11:30:29PM -0500, Sami Imseih wrote:
> When an error is returned from a callback, the error block in 0002 only
> discards the core stats temp file and then moves on to call the finish
> callback for every extension that registered one ( and they better register
> one to perform cleanups ). So, the proposed will not cause any missed
> cleanups of auxiliary files.
Really? How do you make sure that an error is detected if you are
dealing with multiple stats kinds where each one of them have their
own set of auxiliary files to write to, say:
- 2 custom stats kinds, each one uses one auxiliary file.
- Write of the stats at shutdown.
- Suddenly kind 1 fails, returns a status. Its auxiliary file is
removable due to the ferror(), the main stats file is also discarded.
Kind 2 may not have the opportunity to mark its file as problematic,
meaning that it would be skipped at finish(STATS_WRITE) and left
around, especially if we are dealing with the most common scenarios of
an ENOSPC or an EROFS with all these files written on the same
partition, most likely the one of the root data folder.
--
Michael
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Mahendra Singh Thalor | 2026-07-14 08:30:54 | Restore check_mut_excl_opts, usage in pg_restore and pg_dumpall |
| Previous Message | Daniel Gustafsson | 2026-07-14 07:49:11 | Re: Grab bag of smaller OpenSSL fixups |