mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-10 15:02:56 +00:00
Update pgxn/neon/pagestore_smgr.c
Co-authored-by: Heikki Linnakangas <heikki@neon.tech>
This commit is contained in:
committed by
Konstantin Knizhnik
parent
ec89876612
commit
b36c02dda5
@@ -1625,8 +1625,10 @@ neon_write(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum, const vo
|
||||
}
|
||||
if (relperst == NEON_RELPERSISTENCE_UNLOGGED_BUILD)
|
||||
{
|
||||
/* In case of unlogged build we need to avoid race condition at unlogged build end.
|
||||
* Obtain shared lock here to prevent backend completing unlogged build from performing cleanup amnd remvong files.
|
||||
/*
|
||||
* A relation going through an unlogged build can complete the unlogged build at any time.
|
||||
* To make sure that the backend performing the build doesn't complete and
|
||||
* remove the underlying local file just when we are about to write it, acquire the lock.
|
||||
*/
|
||||
LWLockAcquire(finish_unlogged_build_lock, LW_SHARED);
|
||||
is_locked = true;
|
||||
|
||||
Reference in New Issue
Block a user