mirror of
https://github.com/neondatabase/neon.git
synced 2025-12-25 15:19:58 +00:00
Update pgxn/neon/relperst_cache.c
Co-authored-by: Heikki Linnakangas <heikki@neon.tech>
This commit is contained in:
committed by
Konstantin Knizhnik
parent
6164f5eaeb
commit
dd1440960a
@@ -29,18 +29,17 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The main goal of this cache is to avoid calls of mdexists in neon_write,
|
* The main goal of this cache is to avoid repeated calls of mdexists in neon_write,
|
||||||
* which is needed to distinguish unlogged relations.
|
* which is needed to distinguish unlogged relations.
|
||||||
|
* It has a fixed size, implementing eviction with the LRU algorithm.
|
||||||
*
|
*
|
||||||
* This hash is also used to mark relation during unlogged build.
|
* This hash is also used to mark a relation during an unlogged build.
|
||||||
* It has limited size, implementing eviction based on LRU algorithm.
|
* Relations involved in unlogged build are pinned in the cache and never evicted. (Relying
|
||||||
* Relations involved in unlogged build are pinned in the cache (assuming that
|
* on the fact that the number of concurrent unlogged builds is small). Evicting a page
|
||||||
* number of concurrent unlogged build is small.
|
* belonging to an unlogged build involves an extra locking step to eliminate a race condition
|
||||||
*
|
* between unlogged build completing and deleted the local file, at the same time that
|
||||||
* Another task of this hash is to prevent race condition during unlogged build termination.
|
* another backend is evicting a page belonging to it. See how `finish_unlogged_build_lock`
|
||||||
* Some backend may want to evict page which backenf performing unlogged build can complete it and unlinking local files.
|
* is used in `neon_write`
|
||||||
* We are using shared lock which is hold during all write operation. As far as lock is shared is doesn't prevent concurrent writes.
|
|
||||||
* Exclusive lock is taken by unlogged_build_end to change relation kind.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
|||||||
Reference in New Issue
Block a user