Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 0A5A56324A1; Tue, 20 Apr 2010 06:48:03 -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 22582-04; Tue, 20 Apr 2010 09:47:53 +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-gy0-f174.google.com (mail-gy0-f174.google.com [209.85.160.174]) by mail.postgresql.org (Postfix) with ESMTP id 73212632C2E; Tue, 20 Apr 2010 06:47:52 -0300 (ADT) Received: by gyg13 with SMTP id 13so3124080gyg.19 for ; Tue, 20 Apr 2010 02:47:51 -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=hOAZYdsZulS3xXJ3JtCew04lkATnLItxt5Jiuq3eaNE=; b=V/qM2iHcKHEDFzf75tJk44ah2/t3yUe4dyOYE6PXHDtR4jqk8CD/cTtJtXKYcMMqnX U2lUFf+OeVWZmE03MchZ27GQwc8rmZDpFH0JOWjcJ3o1ob7vwIN2GMnccucRW7p5MZNp Q0i6j6WqzWfGFXcH6nprhVgiZVhpeQ3nuuXrE= 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=A5ySa5Nn4mvwV5zyU6Iy9pvwMwHgAHMlybdafBuPjaDaE3DyxECz8mWLCn5FzFfE0N FJwY+qQ/APdb8ThLMbhgZOXr3fEZ8USh+x+Y/7o4C9Qc6HxbmRVG8heYbjwqOIZBEtV9 E1C+vYL5y1GgeoWtah7ib3WfKoN3nDafgCquw= MIME-Version: 1.0 Received: by 10.100.142.12 with HTTP; Tue, 20 Apr 2010 02:47:51 -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: Tue, 20 Apr 2010 18:47:51 +0900 Received: by 10.100.50.7 with SMTP id x7mr14830851anx.191.1271756871738; Tue, 20 Apr 2010 02:47:51 -0700 (PDT) Message-ID: Subject: Re: [HACKERS] Streaming replication document improvements From: Fujii Masao To: Robert Haas 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/63 X-Sequence-Number: 5462 On Tue, Apr 20, 2010 at 11:04 AM, Robert Haas wrote= : > Instead of doing this, could we just change the logic in InitPostgres? > > Current logic says we hit the connection limit if: > > =A0 =A0 =A0 =A0if (!am_superuser && > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ReservedBackends > 0 && > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0!HaveNFreeProcs(ReservedBackends)) > > Couldn't we just change this to: > > =A0 =A0 =A0 =A0if ((!am_superuser || am_walsender) && > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ReservedBackends > 0 && > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0!HaveNFreeProcs(ReservedBackends)) > > Seems like that'd be a whole lot simpler, if it'll do the job... It's very simple, but prevents superuser replication connection from being established when connection limit exceeds for non-superusers. It seems strange to me that superuser cannot use superuser_reserved_connections slots. If we'd like to forbid replication connection to use the slots, I think that we should just get rid of a superuser privilege from it instead. Regards, --=20 Fujii Masao NIPPON TELEGRAPH AND TELEPHONE CORPORATION NTT Open Source Software Center