postgresql/contrib/dblink
Robert Haas 568d4138c6 Use an MVCC snapshot, rather than SnapshotNow, for catalog scans.
SnapshotNow scans have the undesirable property that, in the face of
concurrent updates, the scan can fail to see either the old or the new
versions of the row.  In many cases, we work around this by requiring
DDL operations to hold AccessExclusiveLock on the object being
modified; in some cases, the existing locking is inadequate and random
failures occur as a result.  This commit doesn't change anything
related to locking, but will hopefully pave the way to allowing lock
strength reductions in the future.

The major issue has held us back from making this change in the past
is that taking an MVCC snapshot is significantly more expensive than
using a static special snapshot such as SnapshotNow.  However, testing
of various worst-case scenarios reveals that this problem is not
severe except under fairly extreme workloads.  To mitigate those
problems, we avoid retaking the MVCC snapshot for each new scan;
instead, we take a new snapshot only when invalidation messages have
been processed.  The catcache machinery already requires that
invalidation messages be sent before releasing the related heavyweight
lock; else other backends might rely on locally-cached data rather
than scanning the catalog at all.  Thus, making snapshot reuse
dependent on the same guarantees shouldn't break anything that wasn't
already subtly broken.

Patch by me.  Review by Michael Paquier and Andres Freund.
2013-07-02 09:47:01 -04:00
..
expected Fix contrib/dblink to handle inconsistent DateStyle/IntervalStyle safely. 2013-03-22 15:22:54 -04:00
sql Fix contrib/dblink to handle inconsistent DateStyle/IntervalStyle safely. 2013-03-22 15:22:54 -04:00
.gitignore Support "make check" in contrib 2011-04-25 22:27:11 +03:00
dblink--1.0--1.1.sql Create an improved FDW option validator function for contrib/dblink. 2012-10-10 16:53:08 -04:00
dblink--1.1.sql Create an improved FDW option validator function for contrib/dblink. 2012-10-10 16:53:08 -04:00
dblink--unpackaged--1.0.sql Throw a useful error message if an extension script file is fed to psql. 2011-10-12 15:45:03 -04:00
dblink.c Use an MVCC snapshot, rather than SnapshotNow, for catalog scans. 2013-07-02 09:47:01 -04:00
dblink.control Create an improved FDW option validator function for contrib/dblink. 2012-10-10 16:53:08 -04:00
dblink.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
Makefile Add mode where contrib installcheck runs each module in a separately named database. 2012-12-11 11:52:45 -05:00