Correct shared memory size calculation for Shared Queue hashtable.
authorPavan Deolasee <[email protected]>
Thu, 5 May 2016 03:48:34 +0000 (09:18 +0530)
committerPavan Deolasee <[email protected]>
Thu, 5 May 2016 03:48:34 +0000 (09:18 +0530)
src/backend/pgxc/squeue/squeue.c

index 6b96208fa97b6e06faf953a78a884c81fe326c59..09700c1af327acc8526cbbfcc61ae8c74bbb2ea3 100644 (file)
@@ -243,13 +243,10 @@ SharedQueuesInit(void)
 Size
 SharedQueueShmemSize(void)
 {
-       Size sq_size;
        Size sqs_size;
 
-       sq_size = mul_size(NUM_SQUEUES, SQUEUE_SIZE);
        sqs_size = mul_size(NUM_SQUEUES, SQUEUE_SYNC_SIZE);
-
-       return add_size(sq_size, sqs_size);
+       return add_size(sqs_size, hash_estimate_size(NUM_SQUEUES, SQUEUE_SIZE));
 }
 
 /*