diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-05-04 16:07:29 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-05-04 16:07:29 +0000 |
commit | 52667d56a3b489e5645f069522631824b7ffc520 (patch) | |
tree | fc53caf8cff281d944b0bcb1dd2b10f9e9e5b0c4 /src/backend/storage/lmgr/lmgr.c | |
parent | cb98e6fb8fd4f1ca955a85d5c0088e42e77a04f0 (diff) | |
download | postgresql-52667d56a3b489e5645f069522631824b7ffc520.tar.gz postgresql-52667d56a3b489e5645f069522631824b7ffc520.zip |
Rethink the locking mechanisms used for CREATE/DROP/RENAME DATABASE.
The former approach used ExclusiveLock on pg_database, which being a
cluster-wide lock meant only one of these operations could proceed at
a time; worse, it also blocked all incoming connections in ReverifyMyDatabase.
Now that we have LockSharedObject(), we can use locks of different types
applied to databases considered as objects. This allows much more
flexible management of the interlocking: two CREATE DATABASEs need not
block each other, and need not block connections except to the template
database being used. Similarly DROP DATABASE doesn't block unrelated
operations. The locking used in flatfiles.c is also much narrower in
scope than before. Per recent proposal.
Diffstat (limited to 'src/backend/storage/lmgr/lmgr.c')
-rw-r--r-- | src/backend/storage/lmgr/lmgr.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/storage/lmgr/lmgr.c b/src/backend/storage/lmgr/lmgr.c index 76103d69016..09e9c8b7e9b 100644 --- a/src/backend/storage/lmgr/lmgr.c +++ b/src/backend/storage/lmgr/lmgr.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/storage/lmgr/lmgr.c,v 1.82 2006/03/05 15:58:38 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/storage/lmgr/lmgr.c,v 1.83 2006/05/04 16:07:29 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -478,6 +478,9 @@ LockSharedObject(Oid classid, Oid objid, uint16 objsubid, objsubid); (void) LockAcquire(&tag, false, lockmode, false, false); + + /* Make sure syscaches are up-to-date with any changes we waited for */ + AcceptInvalidationMessages(); } /* |