postgresql/src/backend
Tom Lane d2088ae949 Move RegisterPredicateLockingXid() call to a safer place.
The SSI patch inserted a call of RegisterPredicateLockingXid into
GetNewTransactionId, which was a bad idea on a couple of grounds.  First,
it's not necessary to hold XidGenLock while manipulating that shared
memory, and doing so is bad because XidGenLock is a high-contention lock
that should be held for as short a time as possible.  (Not to mention that
it adds an entirely unnecessary deadlock hazard, since we must take
SerializableXactHashLock as well.)  Second, the specific place where it was
put was between extending CLOG and advancing nextXid, which could result in
unpleasant behavior in case of a failure there.  Pull the call out to
AssignTransactionId, which is much safer and arguably better from a
modularity standpoint too.

There is more work to do to clean up the failure-before-advancing-nextXid
issue, but that is a separate change that will need to be back-patched.
So for the moment I just want to make GetNewTransactionId look the same as
it did in prior versions.
2011-05-06 12:57:28 -04:00
..
access Move RegisterPredicateLockingXid() call to a safer place. 2011-05-06 12:57:28 -04:00
bootstrap Refactor broken CREATE TABLE IF NOT EXISTS support. 2011-04-25 16:55:11 -04:00
catalog Refactor broken CREATE TABLE IF NOT EXISTS support. 2011-04-25 16:55:11 -04:00
commands Clarify error message when attempting to create index on foreign table 2011-05-05 21:47:42 +02:00
executor Refactor broken CREATE TABLE IF NOT EXISTS support. 2011-04-25 16:55:11 -04:00
foreign Clean up most -Wunused-but-set-variable warnings from gcc 4.6 2011-04-11 22:28:45 +03:00
lib Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
libpq Rephrase some not-supported error messages in pg_hba.conf processing. 2011-04-26 15:56:28 -04:00
main Assorted minor changes to silence Windows compiler warnings. 2011-04-25 12:56:53 -04:00
nodes Fix handling of collations in multi-row VALUES constructs. 2011-04-18 15:31:52 -04:00
optimizer Fix pull_up_sublinks' failure to handle nested pull-up opportunities. 2011-05-02 15:57:28 -04:00
parser Remove precedence labeling of keywords TRUE, FALSE, UNKNOWN, and ZONE. 2011-05-05 20:38:52 -04:00
po Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
port Use an explicit format string to keep the compiler happy. 2011-04-27 10:02:21 -04:00
postmaster Add some casts to try to silence most of the remaining format warnings on MinGW-W64. 2011-04-28 15:05:58 -04:00
regex Insert dummy "break"s to silence compiler complaints. 2011-04-10 18:44:07 -04:00
replication Lowercase status labels in pg_stat_replication view. 2011-04-29 22:20:43 -04:00
rewrite Clean up most -Wunused-but-set-variable warnings from gcc 4.6 2011-04-11 22:28:45 +03:00
snowball Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
storage Add fast paths for cases when no serializable transactions are running. 2011-04-25 09:52:01 -04:00
tcop Refactor broken CREATE TABLE IF NOT EXISTS support. 2011-04-25 16:55:11 -04:00
tsearch Improve aset.c's space management in contexts with small maxBlockSize. 2011-05-02 12:08:08 -04:00
utils Improve aset.c's space management in contexts with small maxBlockSize. 2011-05-02 12:08:08 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
Makefile replication/repl_gram.h needs to be cleaned too ... 2011-03-10 00:12:38 -05:00
common.mk Workaround for recursive make breakage 2011-01-13 09:32:06 +02:00
nls.mk Revise the API for GUC variable assign hooks. 2011-04-07 00:12:02 -04:00