bdr: fix shmem size computation for the recent dynamic bgworker change
authorAndres Freund <[email protected]>
Fri, 18 Apr 2014 12:00:34 +0000 (14:00 +0200)
committerAndres Freund <[email protected]>
Thu, 3 Jul 2014 15:55:25 +0000 (17:55 +0200)
contrib/bdr/bdr.c

index bde178e8ecf7f4fea6827c59d9a94eea5608b94f..4f9d1ac8b2d9b04f74bf244bb409bf1a200cffd5 100644 (file)
@@ -1036,7 +1036,12 @@ bdr_perdb_worker_main(Datum main_arg)
 
 static size_t bdr_worker_shm_size()
 {
-   return sizeof(BdrWorker) * bdr_max_workers;
+   Size        size = 0;
+
+   size = add_size(size, sizeof(BdrWorkerControl));
+   size = add_size(size, mul_size(bdr_max_workers, sizeof(BdrWorker)));
+
+   return size;
 }
 
 /*