pg_dump and concurrent DDL activity

From: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(at)2ndquadrant(dot)com>
Subject: pg_dump and concurrent DDL activity
Date: 2020-06-09 14:00:13
Message-ID: CAExHW5v_-FWJxn+srfQc8U3wzdZwcUWM4JMKAafuJnZHVPFAMw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi All,
prologue of pg_dump.c says
* Note that pg_dump runs in a transaction-snapshot mode transaction,
* so it sees a consistent snapshot of the database including system
* catalogs. However, it relies in part on various specialized backend
* functions like pg_get_indexdef(), and those things tend to look at
* the currently committed state. So it is possible to get 'cache
* lookup failed' error if someone performs DDL changes while a dump is
* happening. The window for this sort of thing is from the acquisition
* of the transaction snapshot to getSchemaData() (when pg_dump acquires
* AccessShareLock on every table it intends to dump). It isn't very large,
* but it can happen.

But this possible failure has not been documented at
https://www.postgresql.org/docs/12/app-pgdump.html. Although the
window for failure is small, it's not impossible.Should we document
this kind of failure?

--
Best Wishes,
Ashutosh Bapat

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-06-09 14:11:52 Re: text coverage for EXTRACT()
Previous Message Amit Kapila 2020-06-09 13:28:54 Re: Bump default wal_level to logical