Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit52f1b2f

Browse files
committed
Prevent priority inversion in locking by checking for existing locks
before going into queue behind person with higher piority.
1 parent7d62e9c commit52f1b2f

File tree

5 files changed

+34
-34
lines changed

5 files changed

+34
-34
lines changed

‎HISTORY

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
PostgreSQL 6.5 Fri Apr 23 17:40:19 EDT 1999
2+
=========================================================
3+
4+
A dump/restore is required.
5+
6+
PLACE HOLDER
7+
18
PostgreSQL 6.4.2 Sat Jan 2 11:04:05 EST 1999
29
=========================================================
310

‎doc/src/sgml/install.sgml

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Abstract>
55
<Para>
66
Complete installation instructions for
7-
<ProductName>Postgres</ProductName> v6.4.
7+
<ProductName>Postgres</ProductName> v6.5.
88
</Para>
99
</Abstract>
1010

@@ -167,8 +167,8 @@ remaining steps in the installation will happen in this account.
167167
<Step Performance="required">
168168
<Para>
169169
Ftp file
170-
<ulink url="ftp://ftp.postgresql.org/pub/postgresql-v6.4.tar.gz">
171-
<filename>ftp://ftp.postgresql.org/pub/postgresql-v6.4.tar.gz</filename></ulink>
170+
<ulink url="ftp://ftp.postgresql.org/pub/postgresql-v6.5.tar.gz">
171+
<filename>ftp://ftp.postgresql.org/pub/postgresql-v6.5.tar.gz</filename></ulink>
172172
from the Internet. Store it in your home directory.
173173
</Para>
174174
</Step>
@@ -268,7 +268,7 @@ from the new distribution:
268268

269269
<ProgramListing>
270270
$ cd
271-
$ gunzip -c postgresql-v6.4.tar.gz \
271+
$ gunzip -c postgresql-v6.5.tar.gz \
272272
| tar xvf - src/bin/pg_dump/pg_dumpall
273273
$ chmod a+x src/bin/pg_dump/pg_dumpall
274274
$ src/bin/pg_dump/pg_dumpall -z > db.out
@@ -411,7 +411,7 @@ $ exit
411411
Unzip and untar the new source file. Type
412412
<ProgramListing>
413413
$ cd /usr/src/pgsql
414-
$ gunzip -c ~/postgresql-v6.4.tar.gz | tar xvf -
414+
$ gunzip -c ~/postgresql-v6.5.tar.gz | tar xvf -
415415
</ProgramListing>
416416
</Para>
417417
</Step>
@@ -989,17 +989,7 @@ For example,
989989
<listitem>
990990
<Para>
991991
For a i686/Linux-ELF platform, no tests failed since this is the
992-
v6.4 regression testing reference platform.
993-
</Para>
994-
</listitem>
995-
996-
<listitem>
997-
<Para>
998-
For the SPARC/Linux-ELF platform, using the 970525 beta version of
999-
<ProductName>Postgres</ProductName> v6.2 the following tests "failed":
1000-
float8 and geometry "failed" due to minor precision differences in
1001-
floating point numbers. select_views produces massively different output,
1002-
but the differences are due to minor floating point differences.
992+
v6.5 regression testing reference platform.
1003993
</Para>
1004994
</listitem>
1005995

@@ -1109,11 +1099,11 @@ VACUUM;
11091099
<Para>
11101100
Clean up after yourself. Type
11111101
<ProgramListing>
1112-
$ rm -rf /usr/src/pgsql_6_0
1113-
$ rm -rf /usr/local/pgsql_6_0
1102+
$ rm -rf /usr/src/pgsql_6_5
1103+
$ rm -rf /usr/local/pgsql_6_5
11141104
# Also delete old database directory tree if it is not in
1115-
# /usr/local/pgsql_6_0/data
1116-
$ rm ~/postgresql-v6.2.1.tar.gz
1105+
# /usr/local/pgsql_6_5/data
1106+
$ rm ~/postgresql-v6.5.tar.gz
11171107
</ProgramListing>
11181108
</Para>
11191109
</Step>
@@ -1160,7 +1150,7 @@ $ lpr -l -s -r manpage.hp
11601150
<itemizedlist>
11611151
<listitem>
11621152
<para>
1163-
The version of <ProductName>Postgres</ProductName> (v6.4, 6.3.2, beta 981014, etc.).
1153+
The version of <ProductName>Postgres</ProductName> (v6.5, 6.4.2, beta 981014, etc.).
11641154
</para>
11651155
</listitem>
11661156

‎src/Makefile.shlib

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Copyright (c) 1998, Regents of the University of California
77
#
88
# IDENTIFICATION
9-
# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.7 1999/03/14 16:02:57 momjian Exp $
9+
# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.8 1999/04/3002:04:49 momjian Exp $
1010
#
1111
#-------------------------------------------------------------------------
1212

@@ -86,14 +86,14 @@ ifeq ($(PORTNAME), bsdi)
8686
ifdef BSD_SHLIB
8787
ifeq ($(DLSUFFIX), .so)
8888
install-shlib-dep := install-shlib
89-
shlib:= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
89+
shlib:= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
9090
LDFLAGS_SL+= -shared
9191
CFLAGS+= $(CFLAGS_SL)
9292
endif
9393
ifeq ($(DLSUFFIX), .o)
9494
install-shlib-dep:= install-shlib
95-
shlib:= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
96-
LD:= shlicc
95+
shlib:= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
96+
LD:= shlicc
9797
LDFLAGS_SL += -O -r
9898
CFLAGS+= $(CFLAGS_SL)
9999
endif

‎src/backend/storage/lmgr/lock.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.46 1999/03/06 21:17:44 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.47 1999/04/30 02:04:50 momjian Exp $
1111
*
1212
* NOTES
1313
* Outside modules can create a lock table and acquire/release
@@ -820,13 +820,17 @@ LockResolveConflicts(LOCKMETHOD lockmethod,
820820
/* ------------------------
821821
* If someone with a greater priority is waiting for the lock,
822822
* do not continue and share the lock, even if we can.bjm
823+
* Don't do this if the process already has some locks, because
824+
* this could hold up other people waiting on our locks, causing
825+
* a priority inversion. bjm
823826
* ------------------------
824827
*/
825828
intmyprio=LockMethodTable[lockmethod]->ctl->prio[lockmode];
826829
PROC_QUEUE*waitQueue=&(lock->waitProcs);
827830
PROC*topproc= (PROC*)MAKE_PTR(waitQueue->links.prev);
828831

829-
if (waitQueue->size&&topproc->prio>myprio)
832+
if (SHMQueueEmpty(lockQueue)&&waitQueue->size&&
833+
topproc->prio>myprio)
830834
{
831835
XID_PRINT("LockResolveConflicts: higher priority proc waiting",
832836
result);
@@ -1595,7 +1599,7 @@ DeadLockCheck(SHM_QUEUE *lockQueue, LOCK *findlock, bool skip_check)
15951599
*
15961600
* The lock we are waiting for is already in MyProc->lockQueue so we
15971601
* need to skip it here. We are trying to find it in someone
1598-
* else's lockQueue.
1602+
* else's lockQueue. bjm
15991603
*/
16001604
if (lock==findlock&& !skip_check)
16011605
return true;
@@ -1625,7 +1629,7 @@ DeadLockCheck(SHM_QUEUE *lockQueue, LOCK *findlock, bool skip_check)
16251629
*
16261630
* Basically, the test is, "Do we both hold some lock on
16271631
* findlock, and we are both waiting in the lock
1628-
* queue?"
1632+
* queue?" bjm
16291633
*/
16301634

16311635
Assert(skip_check);
@@ -1672,7 +1676,7 @@ DeadLockCheck(SHM_QUEUE *lockQueue, LOCK *findlock, bool skip_check)
16721676
* hold locks and are waiting. Now we check for
16731677
* cases where we have two or more tables in a
16741678
* deadlock. We do this by continuing to search
1675-
* for someone holding a lock
1679+
* for someone holding a lock bjm
16761680
*/
16771681
if (DeadLockCheck(&(proc->lockQueue),findlock, false))
16781682
return true;

‎src/backend/storage/lmgr/proc.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.52 1999/03/28 20:32:26 vadim Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.53 1999/04/30 02:04:51 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -46,7 +46,7 @@
4646
*This is so that we can support more backends. (system-wide semaphore
4747
*sets run out pretty fast.) -ay 4/95
4848
*
49-
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.52 1999/03/28 20:32:26 vadim Exp $
49+
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.53 1999/04/30 02:04:51 momjian Exp $
5050
*/
5151
#include<sys/time.h>
5252
#include<unistd.h>
@@ -516,8 +516,7 @@ ProcSleep(PROC_QUEUE *waitQueue,/* lock->waitProcs */
516516
* In a full queue, we would have a reader holding a lock, then a writer
517517
* gets the lock, then a bunch of readers, made up of readers who
518518
* could not share the first readlock because a writer was waiting,
519-
* and new readers arriving while the writer had the lock.
520-
*
519+
* and new readers arriving while the writer had the lock. bjm
521520
*/
522521
proc= (PROC*)MAKE_PTR(waitQueue->links.prev);
523522

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp