Skip to content

Commit 17d8de0

Browse files
committed
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
1 parent 8c9a120 commit 17d8de0

File tree

1 file changed

+2
-2
lines changed
  • src/backend/access/transam

1 file changed

+2
-2
lines changed

src/backend/access/transam/xlog.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.379 2010/02/26 02:00:35 momjian Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.380 2010/03/10 02:04:48 itagaki Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -7897,7 +7897,7 @@ pg_start_backup(PG_FUNCTION_ARGS)
78977897
* REDO pointer. The oldest point in WAL that would be needed to
78987898
* restore starting from the checkpoint is precisely the REDO pointer.
78997899
*/
7900-
LWLockAcquire(ControlFileLock, LW_EXCLUSIVE);
7900+
LWLockAcquire(ControlFileLock, LW_SHARED);
79017901
checkpointloc = ControlFile->checkPoint;
79027902
startpoint = ControlFile->checkPointCopy.redo;
79037903
LWLockRelease(ControlFileLock);

0 commit comments

Comments
 (0)