diff options
author | Robert Haas <rhaas@postgresql.org> | 2011-09-27 09:30:23 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2011-09-27 09:30:23 -0400 |
commit | f70648d5a16b4b048cacd04b82079e6734449bc2 (patch) | |
tree | be13c02d877277e002a1068b82d2a29442f1280a /src/backend/access/heap/hio.c | |
parent | a9d845be496b779efbcf16095bf236639e9e7665 (diff) | |
download | postgresql-f70648d5a16b4b048cacd04b82079e6734449bc2.tar.gz postgresql-f70648d5a16b4b048cacd04b82079e6734449bc2.zip |
Update comments related to the crash-safety of the visibility map.
In hio.c, document how we avoid deadlock with respect to visibility map
buffer locks. In visibilitymap.c, update the LOCKING section of the
file header comment.
Both oversights noted by Heikki Linnakangas.
Diffstat (limited to 'src/backend/access/heap/hio.c')
-rw-r--r-- | src/backend/access/heap/hio.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/backend/access/heap/hio.c b/src/backend/access/heap/hio.c index b4ea84a6141..26db1e3d8d0 100644 --- a/src/backend/access/heap/hio.c +++ b/src/backend/access/heap/hio.c @@ -178,6 +178,10 @@ GetVisibilityMapPins(Relation relation, Buffer buffer1, Buffer buffer2, * happen if space is freed in that page after heap_update finds there's not * enough there). In that case, the page will be pinned and locked only once. * + * For the vmbuffer and vmbuffer_other arguments, we avoid deadlock by + * locking them only after locking the corresponding heap page, and taking + * no further lwlocks while they are locked. + * * We normally use FSM to help us find free space. However, * if HEAP_INSERT_SKIP_FSM is specified, we just append a new empty page to * the end of the relation if the tuple won't fit on the current target page. |