pg_dump and concurrent DDL activity - Mailing list pgsql-hackers

From Ashutosh Bapat
Subject pg_dump and concurrent DDL activity
Date
Msg-id CAExHW5v_-FWJxn+srfQc8U3wzdZwcUWM4JMKAafuJnZHVPFAMw@mail.gmail.com
Whole thread Raw
List 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



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Bump default wal_level to logical
Next
From: Tom Lane
Date:
Subject: Re: text coverage for EXTRACT()