bdr: If bdr.max_connections is zero, don't try to allocate -1 shmem
authorCraig Ringer <craig@2ndquadrant.com>
Mon, 21 Apr 2014 05:51:31 +0000 (13:51 +0800)
committerAndres Freund <andres@anarazel.de>
Thu, 3 Jul 2014 15:55:25 +0000 (17:55 +0200)
contrib/bdr/bdr.c

index 74df6b690b2fcc809dc78b0b433a80d67587d4f1..3f5dba4c4cca5cf3eef6e8ac7a50903d8d13c0eb 100644 (file)
@@ -1309,7 +1309,12 @@ _PG_init(void)
 
    /* if nothing is configured, we're done */
    if (connections == NULL)
+   {
+       /* If worker count autoconfigured, use zero */
+       if (bdr_max_workers == -1)
+           bdr_max_workers = 0;
        goto out;
+   }
 
    /* Copy 'connections' guc so SplitIdentifierString can modify it in-place */
    connections_tmp = pstrdup(connections);