From f70648d5a16b4b048cacd04b82079e6734449bc2 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Tue, 27 Sep 2011 09:30:23 -0400 Subject: 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. --- src/backend/access/heap/hio.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/backend/access/heap/hio.c') 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. -- cgit v1.2.3