summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorItagaki Takahiro <itagaki.takahiro@gmail.com>2010-03-10 02:04:48 +0000
committerItagaki Takahiro <itagaki.takahiro@gmail.com>2010-03-10 02:04:48 +0000
commit17d8de0e6102d288a0745cb30499411c2e7ad213 (patch)
treefbb5e587d4e79f3522bdeea243a991e6deb1517b
parent8c9a120f6b1e181812a31830416488bac2f8ba92 (diff)
pg_start_backup() can use a share lock to lock ControlFileLock
instead of an exclusive lock. The change is almost for code cleanup. Since there seems to be no performance benefits from it, backports should not be needed. Fujii Masao
-rw-r--r--src/backend/access/transam/xlog.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index d753a31cb35..55d1ea05490 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.379 2010/02/26 02:00:35 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.380 2010/03/10 02:04:48 itagaki Exp $
*
*-------------------------------------------------------------------------
*/
@@ -7897,7 +7897,7 @@ pg_start_backup(PG_FUNCTION_ARGS)
* REDO pointer. The oldest point in WAL that would be needed to
* restore starting from the checkpoint is precisely the REDO pointer.
*/
- LWLockAcquire(ControlFileLock, LW_EXCLUSIVE);
+ LWLockAcquire(ControlFileLock, LW_SHARED);
checkpointloc = ControlFile->checkPoint;
startpoint = ControlFile->checkPointCopy.redo;
LWLockRelease(ControlFileLock);