pgsql: Improve failure detection with array parsing in pg_dump

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Improve failure detection with array parsing in pg_dump
Date: 2020-11-19 01:36:28
Message-ID: E1kfYs8-000898-Oc@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Improve failure detection with array parsing in pg_dump

Similarly to 3636efa, the checks done in pg_dump when parsing array
values from catalogs have been too lax. Under memory pressure, it could
be possible, though very unlikely, to finish with dumps that miss some
data like:
- Statistics for indexes
- Run-time configuration of functions
- Configuration of extensions
- Publication list for a subscription

No backpatch is done as this is not going to be a problem in practice.
For example, if an OOM causes an array parsing to fail, a follow-up code
path of pg_dump would most likely complain with an allocation failure
due to the memory pressure.

Author: Michael Paquier
Reviewed-by: Daniel Gustafsson
Discussion: https://postgr.es/m/20201111061319.GE2276@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/13b58f8934e6252868231c3493d49b8c2b363e5d

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 51 +++++++++++++++++++++++++----------------------
1 file changed, 27 insertions(+), 24 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Thomas Munro 2020-11-19 05:14:56 pgsql: Add BarrierArriveAndDetachExceptLast().
Previous Message Alvaro Herrera 2020-11-18 16:26:04 pgsql: Relax lock level for setting PGPROC->statusFlags