A session that does not have any live snapshots does not have to be waited for
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 4 Apr 2009 17:40:36 +0000 (17:40 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 4 Apr 2009 17:40:36 +0000 (17:40 +0000)
commit572e20cff5e2dfbed105e6abb016431b4be473f1
tree2cf3d6929310d060e9d47f8ebf22415543d4aac4
parentbe058e02344eadb8fffaa6953c5e8c803454b3a3
A session that does not have any live snapshots does not have to be waited for
when we are waiting for old snapshots to go away during a concurrent index
build.  In particular, this rule lets us avoid waiting for
idle-in-transaction sessions.

This logic could be improved further if we had some way to wake up when
the session we are currently waiting for goes idle-in-transaction.  However
that would be a significantly more complex/invasive patch, so it'll have to
wait for some other day.

Simon Riggs, with some improvements by Tom.
src/backend/commands/indexcmds.c
src/backend/storage/ipc/procarray.c
src/include/storage/lock.h
src/include/storage/procarray.h