OSDN Git Service

HS Defer buffer pin deadlock check until deadlock_timeout has expired.
authorSimon Riggs <simon@2ndQuadrant.com>
Wed, 26 May 2010 19:52:52 +0000 (19:52 +0000)
committerSimon Riggs <simon@2ndQuadrant.com>
Wed, 26 May 2010 19:52:52 +0000 (19:52 +0000)
commitf9dbac94767d64f6a1174506b6e61db34729e015
tree4e92ee8ac96f7c2d9932c128bc73f7d7f1a95625
parent5234a9524510bdff3a339f204d2655e7ce2eb3b5
HS Defer buffer pin deadlock check until deadlock_timeout has expired.
During Hot Standby we need to check for buffer pin deadlocks when the
Startup process begins to wait, in case it never wakes up again. We
previously made the deadlock check immediately on the basis it was
cheap, though clearer thinking and prima facie evidence shows that
was too simple. Refactor existing code to make it easy to add in
deferral of deadlock check until deadlock_timeout allowing a good
reduction in deadlock checks since far few buffer pins are held for
that duration. It's worth doing anyway, though major goal is to
prevent further reports of context switching with high numbers of
users on occasional tests.
src/backend/storage/ipc/standby.c
src/backend/storage/lmgr/proc.c
src/include/storage/proc.h