Fix some potential bugs that not update size results.
At several places we just invoke the function add_size
but does not assign its return value to any variable.
The result is just discarded. This commit fixes this.
@@ -423,8 +423,8 @@ InitLocks(void)
/* Allow for extra entries if resource locking is enabled. */
if (Gp_role == GP_ROLE_DISPATCH && IsResQueueEnabled())
{
- add_size(max_table_size, NRESLOCKENTS() );
- //add_size(max_plock_table_size, NRESPROCLOCKENTS() );
+ max_table_size = add_size(max_table_size, NRESLOCKENTS() );
+ max_table_size = add_size(max_table_size, NRESPROCLOCKENTS() );
}
init_table_size = max_table_size / 2;
@@ -3817,14 +3817,14 @@ LockShmemSize(void)
if (Gp_role == GP_ROLE_DISPATCH && IsResQueueEnabled())
{
- add_size(max_table_size, NRESLOCKENTS() );
+ max_table_size = add_size(max_table_size, NRESLOCKENTS() );
}
size = add_size(size, hash_estimate_size(max_table_size, sizeof(LOCK)));
if (Gp_role == GP_ROLE_DISPATCH && IsResQueueEnabled())
{
- add_size(max_table_size, NRESPROCLOCKENTS() );
+ max_table_size = add_size(max_table_size, NRESPROCLOCKENTS() );
}
/* proclock hash table */
