Content-Length: 266197 | pFad | http://github.com/postgres/postgres/commit/d59ff3be24a336ab080c66fa6ceafbf52e7be1c1

F1 pg_prewarm: Allow autoprewarm to use more than 1GB to dump blocks. · postgres/postgres@d59ff3b · GitHub
Skip to content

Commit d59ff3b

Browse files
committed
pg_prewarm: Allow autoprewarm to use more than 1GB to dump blocks.
Reported-by: Daria Shanina <vilensipkdm@gmail.com> Author: Daria Shanina <vilensipkdm@gmail.com> Author: Robert Haas <robertmhaas@gmail.com> Backpatch-through: 13
1 parent 74637fb commit d59ff3b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

contrib/pg_prewarm/autoprewarm.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,15 @@ apw_dump_now(bool is_bgworker, bool dump_unlogged)
609609
return 0;
610610
}
611611

612-
block_info_array =
613-
(BlockInfoRecord *) palloc(sizeof(BlockInfoRecord) * NBuffers);
612+
/*
613+
* With sufficiently large shared_buffers, allocation will exceed 1GB, so
614+
* allow for a huge allocation to prevent outright failure.
615+
*
616+
* (In the future, it might be a good idea to redesign this to use a more
617+
* memory-efficient data structure.)
618+
*/
619+
block_info_array = (BlockInfoRecord *)
620+
palloc_extended((sizeof(BlockInfoRecord) * NBuffers), MCXT_ALLOC_HUGE);
614621

615622
for (num_blocks = 0, i = 0; i < NBuffers; i++)
616623
{

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgres/postgres/commit/d59ff3be24a336ab080c66fa6ceafbf52e7be1c1

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy