Apply 0017-Revert-changes-to-subtrans.c-and-slru.c.-Instead-cal.patch but with heavy...
authorSimon Riggs <simon@2ndQuadrant.com>
Tue, 6 Oct 2009 11:50:13 +0000 (12:50 +0100)
committerSimon Riggs <simon@2ndQuadrant.com>
Tue, 6 Oct 2009 11:50:13 +0000 (12:50 +0100)
commita09cf45d7764076b2049071b1cc81717cc6384f8
tree0758f206bc76a91b8f2d5b79949562ec64f92ec0
parent90480cc3d7cbdaf08c2df11a1bc16ac2d8f0dce1
Apply 0017-Revert-changes-to-subtrans.c-and-slru.c.-Instead-cal.patch but with heavy modifications to fix a number of bugs and make associated changes. First, StartupSubtrans() positioned itself at oldestXid, so that when later running transactions complete they could find no page for them to update and crash. Second, ExtendClog() expected to be able to write WAL during recovery and so crashed after 32768 xids. This patch also extends the patch to cover the recently added support for starting Hot Standby from a shutdown checkpoint, which causes some refactoring. Various comments reworded, including allowing a lock overflow to cause a PENDING state, just as we do with subxid overflow. Another bug was also found, in that failing to make subtrans entries from the initial snapshot could lead to later abort records hanging because the topxid was not set. Code is now similar in all code paths. Sounds like a lot of changes, but mostly subtle changes rather than lengthy ones.
src/backend/access/transam/clog.c
src/backend/access/transam/slru.c
src/backend/access/transam/subtrans.c
src/backend/access/transam/xlog.c
src/backend/storage/ipc/procarray.c