]> granicus.if.org Git - postgresql/commit
Assorted code review for recent ProcArrayLock patch.
authorRobert Haas <rhaas@postgresql.org>
Thu, 3 Sep 2015 17:10:53 +0000 (13:10 -0400)
committerRobert Haas <rhaas@postgresql.org>
Thu, 3 Sep 2015 17:19:15 +0000 (13:19 -0400)
commit4aec49899e5782247e134f94ce1c6ee926f88e1c
treec01a098b379077cf320910e25fe46a976fc4f58e
parent1ea5ce5c5f204918b8a9fa6eaa8f3f1374aa8aec
Assorted code review for recent ProcArrayLock patch.

Post-commit review by Andres Freund discovered a couple of concurrency
bugs in the original patch: specifically, if the leader cleared a
follower's XID before it reached PGSemaphoreLock, the semaphore would be
left in the wrong state; and if another process did PGSemaphoreUnlock
for some unrelated reason, we might resume execution before the fact
that our XID was cleared was globally visible.

Also, improve the wording of some comments, rename nextClearXidElem
to firstClearXidElem in PROC_HDR for clarity, and drop some volatile
qualifiers that aren't necessary.

Amit Kapila, reviewed and slightly revised by me.
src/backend/storage/ipc/procarray.c
src/backend/storage/lmgr/proc.c
src/include/storage/proc.h