htab-alloc.patch

text/plain

Filename: htab-alloc.patch
Type: text/plain
Part: 0
Message: Re: SSI bug?

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: context
File+
src/backend/storage/lmgr/lock.c 3 0
src/backend/storage/lmgr/predicate.c 3 0
*** a/src/backend/storage/lmgr/lock.c
--- b/src/backend/storage/lmgr/lock.c
***************
*** 281,295 **** InitLocks(void)
  {
  	HASHCTL		info;
  	int			hash_flags;
! 	long		init_table_size,
! 				max_table_size;
  
  	/*
  	 * Compute init/max size to request for lock hashtables.  Note these
  	 * calculations must agree with LockShmemSize!
  	 */
  	max_table_size = NLOCKENTS();
- 	init_table_size = max_table_size / 2;
  
  	/*
  	 * Allocate hash table for LOCK structs.  This stores per-locked-object
--- 281,293 ----
  {
  	HASHCTL		info;
  	int			hash_flags;
! 	long		max_table_size;
  
  	/*
  	 * Compute init/max size to request for lock hashtables.  Note these
  	 * calculations must agree with LockShmemSize!
  	 */
  	max_table_size = NLOCKENTS();
  
  	/*
  	 * Allocate hash table for LOCK structs.  This stores per-locked-object
***************
*** 303,316 **** InitLocks(void)
  	hash_flags = (HASH_ELEM | HASH_FUNCTION | HASH_PARTITION);
  
  	LockMethodLockHash = ShmemInitHash("LOCK hash",
! 									   init_table_size,
  									   max_table_size,
  									   &info,
  									   hash_flags);
  
  	/* Assume an average of 2 holders per lock */
  	max_table_size *= 2;
- 	init_table_size *= 2;
  
  	/*
  	 * Allocate hash table for PROCLOCK structs.  This stores
--- 301,313 ----
  	hash_flags = (HASH_ELEM | HASH_FUNCTION | HASH_PARTITION);
  
  	LockMethodLockHash = ShmemInitHash("LOCK hash",
! 									   max_table_size,
  									   max_table_size,
  									   &info,
  									   hash_flags);
  
  	/* Assume an average of 2 holders per lock */
  	max_table_size *= 2;
  
  	/*
  	 * Allocate hash table for PROCLOCK structs.  This stores
***************
*** 323,329 **** InitLocks(void)
  	hash_flags = (HASH_ELEM | HASH_FUNCTION | HASH_PARTITION);
  
  	LockMethodProcLockHash = ShmemInitHash("PROCLOCK hash",
! 										   init_table_size,
  										   max_table_size,
  										   &info,
  										   hash_flags);
--- 320,326 ----
  	hash_flags = (HASH_ELEM | HASH_FUNCTION | HASH_PARTITION);
  
  	LockMethodProcLockHash = ShmemInitHash("PROCLOCK hash",
! 										   max_table_size,
  										   max_table_size,
  										   &info,
  										   hash_flags);
*** a/src/backend/storage/lmgr/predicate.c
--- b/src/backend/storage/lmgr/predicate.c
***************
*** 959,966 **** InitPredicateLocks(void)
  {
  	HASHCTL		info;
  	int			hash_flags;
! 	long		init_table_size,
! 				max_table_size;
  	Size		requestSize;
  	bool		found;
  
--- 959,965 ----
  {
  	HASHCTL		info;
  	int			hash_flags;
! 	long		max_table_size;
  	Size		requestSize;
  	bool		found;
  
***************
*** 969,975 **** InitPredicateLocks(void)
  	 * Note these calculations must agree with PredicateLockShmemSize!
  	 */
  	max_table_size = NPREDICATELOCKTARGETENTS();
- 	init_table_size = max_table_size / 2;
  
  	/*
  	 * Allocate hash table for PREDICATELOCKTARGET structs.  This stores
--- 968,973 ----
***************
*** 983,996 **** InitPredicateLocks(void)
  	hash_flags = (HASH_ELEM | HASH_FUNCTION | HASH_PARTITION);
  
  	PredicateLockTargetHash = ShmemInitHash("PREDICATELOCKTARGET hash",
! 											init_table_size,
  											max_table_size,
  											&info,
  											hash_flags);
  
  	/* Assume an average of 2 xacts per target */
  	max_table_size *= 2;
- 	init_table_size *= 2;
  
  	/*
  	 * Reserve an entry in the hash table; we use it to make sure there's
--- 981,993 ----
  	hash_flags = (HASH_ELEM | HASH_FUNCTION | HASH_PARTITION);
  
  	PredicateLockTargetHash = ShmemInitHash("PREDICATELOCKTARGET hash",
! 											max_table_size,
  											max_table_size,
  											&info,
  											hash_flags);
  
  	/* Assume an average of 2 xacts per target */
  	max_table_size *= 2;
  
  	/*
  	 * Reserve an entry in the hash table; we use it to make sure there's
***************
*** 1014,1020 **** InitPredicateLocks(void)
  	hash_flags = (HASH_ELEM | HASH_FUNCTION | HASH_PARTITION);
  
  	PredicateLockHash = ShmemInitHash("PREDICATELOCK hash",
! 									  init_table_size,
  									  max_table_size,
  									  &info,
  									  hash_flags);
--- 1011,1017 ----
  	hash_flags = (HASH_ELEM | HASH_FUNCTION | HASH_PARTITION);
  
  	PredicateLockHash = ShmemInitHash("PREDICATELOCK hash",
! 									  max_table_size,
  									  max_table_size,
  									  &info,
  									  hash_flags);