lock the buffer
authorRobert Haas <[email protected]>
Thu, 23 Sep 2021 15:36:53 +0000 (11:36 -0400)
committerRobert Haas <[email protected]>
Thu, 23 Sep 2021 15:36:53 +0000 (11:36 -0400)
src/backend/access/conveyor/conveyor.c

index c8200083a0c46be724eb66c72359d78aea888d81..5e50e647547f95150ed3597cee9f078976f884f6 100644 (file)
@@ -422,8 +422,11 @@ ConveyorBeltGetNewPage(ConveyorBelt *cb, CBPageNo *pageno)
                                                                errmsg_internal("next block should be %u but relation has only %u blocks",
                                                                                                next_blkno, nblocks));
                                else if (next_blkno == nblocks)
+                               {
                                        buffer = ReadBufferExtended(cb->cb_rel, cb->cb_fork,
                                                                                                P_NEW, RBM_NORMAL, NULL);
+                                       LockBuffer(buffer, BUFFER_LOCK_EXCLUSIVE);
+                               }
                                UnlockRelationForExtension(cb->cb_rel, ExclusiveLock);
                        }