Skip to content

Commit

Permalink
Correctly update LFC used_pages in case of LFC resize
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin Knizhnik committed Dec 12, 2024
1 parent 2f3f98a commit f1f90f4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pgxn/neon/file_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,10 @@ lfc_change_limit_hook(int newval, void *extra)
neon_log(LOG, "Failed to punch hole in file: %m");
#endif
/* We remove the old entry, and re-enter a hole to the hash table */
for (int i = 0; i < BLOCKS_PER_CHUNK; i++)
{
lfc_ctl->used_pages -= (victim->bitmap[i >> 5] >> (i & 31)) & 1;
}
hash_search_with_hash_value(lfc_hash, &victim->key, victim->hash, HASH_REMOVE, NULL);

memset(&holetag, 0, sizeof(holetag));
Expand Down

0 comments on commit f1f90f4

Please sign in to comment.