Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 2910C6324A1; Mon, 19 Apr 2010 23:05:13 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 37020-02; Tue, 20 Apr 2010 02:05:02 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-iw0-f187.google.com (mail-iw0-f187.google.com [209.85.223.187]) by mail.postgresql.org (Postfix) with ESMTP id 67D216322D8; Mon, 19 Apr 2010 23:05:02 -0300 (ADT) Received: by iwn17 with SMTP id 17so325284iwn.19 for ; Mon, 19 Apr 2010 19:05:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Az8HkWgaXCVdNCN8gjUcBUdUz6dSIJUWCLlkibrMDvs=; b=vMh+Pvn1AMW2l1y4YtuCqPhL2nE0dUFrvO1txHUqrXjNlgOL8oG4OrFvy+MOj25qoZ /l3tEZ8Eu7QEZzOG/xhqEZjZVySFU1I7Rqx6Hj/svxKMW/pj3Qwq9s723HtZv7a2dQYz VZD3VJjw6J7NnVK0m2CWXH4pDRvzcZJOXMj8o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=uMg31VdlfvBZ7M1XEGRbT60TvHBKA2yKyVL/FgVELLjtre1tQhcRXYTe1lfJrVePJA x/yrJaz2UJ/fKhKw2ssI59CtJYlW4lNzlEufAk4H4AvPu9+dXm9J2Cm2nx5i/I3NXtjD 9Dyv3h2SHKQmKVJKqhoBngHg5SxmgMRG7ykA8= MIME-Version: 1.0 Received: by 10.231.38.194 with HTTP; Mon, 19 Apr 2010 19:04:59 -0700 (PDT) In-Reply-To: References: <3f0b79eb1003300152g5327eb47w8f9aecae6002b215@mail.gmail.com> <4BB49B0C.1050901@enterprisedb.com> <19262.1270142946@sss.pgh.pa.us> <4BB4952D0200002500030333@gw.wicourts.gov> <4BB4DBEF.3010301@agliodbs.com> Date: Mon, 19 Apr 2010 22:04:59 -0400 Received: by 10.231.190.137 with SMTP id di9mr2166280ibb.76.1271729099328; Mon, 19 Apr 2010 19:04:59 -0700 (PDT) Message-ID: Subject: Re: [HACKERS] Streaming replication document improvements From: Robert Haas To: Fujii Masao Cc: Josh Berkus , Kevin Grittner , Tom Lane , Heikki Linnakangas , pgsql-docs@postgresql.org, PostgreSQL-development Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.42 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, FS_REPLICA=3.599, SARE_SPEC_REPLICA=0.72 X-Spam-Level: ** X-Archive-Number: 201004/62 X-Sequence-Number: 5461 On Fri, Apr 2, 2010 at 2:06 AM, Fujii Masao wrote: > On Fri, Apr 2, 2010 at 2:58 AM, Robert Haas wrote= : >> It's probably also easy to fix so that it doesn't NEED to be documented. >> >> The thing is, when dealing with new features, we reduce our overall >> maintenance burden if we get it right the first time. =A0Obviously it's >> too late for major changes, but minor adjustments to maintain the POLA >> seem like exactly what we SHOULD be doing right now. > > The attached patch implements the Heikki's proposal: > > ---------- > ReservedBackends =3D superuser_reserved_connections + max_wal_senders > MaxBackends =3D max_connections + autovacuum_max_workers + max_wal_sender= s + 1 > ---------- > > This change looks like minor adjustments rather than major changes. Instead of doing this, could we just change the logic in InitPostgres? Current logic says we hit the connection limit if: if (!am_superuser && ReservedBackends > 0 && !HaveNFreeProcs(ReservedBackends)) Couldn't we just change this to: if ((!am_superuser || am_walsender) && ReservedBackends > 0 && !HaveNFreeProcs(ReservedBackends)) Seems like that'd be a whole lot simpler, if it'll do the job... ...Robert