mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-14 08:52:56 +00:00
Call lfc_ensure_opened only when it is needed in lfc_change_limit_hook
This commit is contained in:
@@ -336,10 +336,11 @@ lfc_change_limit_hook(int newval, void *extra)
|
||||
{
|
||||
uint32 new_size = SIZE_MB_TO_CHUNKS(newval);
|
||||
|
||||
if (!is_normal_backend())
|
||||
if (!lfc_ctl || !is_normal_backend())
|
||||
return;
|
||||
|
||||
if (!lfc_ensure_opened())
|
||||
/* Open LFC file only if LFC was enabled or we are going to reenable it */
|
||||
if ((newval > 0 || LFC_ENABLED()) && !lfc_ensure_opened())
|
||||
return;
|
||||
|
||||
LWLockAcquire(lfc_lock, LW_EXCLUSIVE);
|
||||
|
||||
Reference in New Issue
Block a user