Commit a171f015 authored by Robert Haas's avatar Robert Haas

Pass DSA_ALLOC_HUGE when allocating a shared TIDBitmap.

When creating an unshared TIDBitmap, we pass MCXT_ALLOC_HUGE to allow
allocations >1GB, so by analogy we pass DSA_ALLOC_HUGE for a shared
TIDBitmap.

Bug introduced by commit 98e6e890.
Report by Rafia Sabih, fix by Dilip Kumar, adjusted by me.

Discussion: http://postgr.es/m/CAOGQiiPpSnkuKq+oUK_bvQFg2EPGFPN8RwgxTgBa6HU_kQa3EA@mail.gmail.com
parent facde2a9
...@@ -1533,9 +1533,11 @@ pagetable_allocate(pagetable_hash *pagetable, Size size) ...@@ -1533,9 +1533,11 @@ pagetable_allocate(pagetable_hash *pagetable, Size size)
* new memory so that pagetable_free can free the old entry. * new memory so that pagetable_free can free the old entry.
*/ */
tbm->dsapagetableold = tbm->dsapagetable; tbm->dsapagetableold = tbm->dsapagetable;
tbm->dsapagetable = dsa_allocate0(tbm->dsa, sizeof(PTEntryArray) + size); tbm->dsapagetable = dsa_allocate_extended(tbm->dsa,
sizeof(PTEntryArray) + size,
DSA_ALLOC_HUGE | DSA_ALLOC_ZERO);
ptbase = dsa_get_address(tbm->dsa, tbm->dsapagetable); ptbase = dsa_get_address(tbm->dsa, tbm->dsapagetable);
return ptbase->ptentry; return ptbase->ptentry;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment