Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VJxXG-0006js-OI for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Sep 2013 03:25:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VJxXG-0007d8-00 for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Sep 2013 03:25:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VJxXD-0007cm-OZ for pgsql-hackers@postgresql.org; Thu, 12 Sep 2013 03:25:35 +0000 Received: from mail-yh0-f53.google.com ([209.85.213.53]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VJxX2-0006Bb-Pm for pgsql-hackers@postgresql.org; Thu, 12 Sep 2013 03:25:35 +0000 Received: by mail-yh0-f53.google.com with SMTP id b20so3177216yha.12 for ; Wed, 11 Sep 2013 20:25:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=K7sKd78AILcGNHbdjBoy7fvLiE+wW1gzIXdDiCAyCRI=; b=lYjRAbatUu6vkYZu5ebt0hZG+kPNksGhuTVJgoZ1SV4+9l2vOuk9RjIGwxaGp5cJrv CJyE6Y0sOxG5GgRN41yBjI8SkdLg6YECDZCB78BgWsTDWhji+SgKitU0EB2M25tlmRHH i1nQe1YOb4BJoqux5teX9HI9UlPGIF/TEQuCz2mB8EH6ENqHGszRpjjIYfkjPN4iA1oR XfGVyGmwHVLoo1WnkuRsyIYs0SHVv6ezi6VEBep2nWaNYRCDy0vWKjA2UBEiYVJuqE5Y YR2V26CUnv4mSK+x7n18bH7AefBEkaXWEdCfhOmvmmPFTEi4/Q1TUdHYRmYH9Tko3sJt AVUQ== X-Gm-Message-State: ALoCoQl9XN5FMt9vPH/czlZxB92Bww2wt7F+OgLDrcoZE6oLHcmUfFBarbglNhutWOyptypUrO5u X-Received: by 10.236.34.168 with SMTP id s28mr4390204yha.50.1378956323357; Wed, 11 Sep 2013 20:25:23 -0700 (PDT) Received: from tornado.leadboat.com (c-107-4-219-91.hsd1.va.comcast.net. [107.4.219.91]) by mx.google.com with ESMTPSA id c6sm2386793yhl.22.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 11 Sep 2013 20:25:22 -0700 (PDT) Date: Wed, 11 Sep 2013 23:25:20 -0400 From: Noah Misch To: David Johnston Cc: pgsql-hackers@postgresql.org Subject: Re: Weaker shmem interlock w/o postmaster.pid Message-ID: <20130912032520.GA261339@tornado.leadboat.com> References: <20130911033341.GD225735@tornado.leadboat.com> <20130911153200.GD2706@tamriel.snowman.net> <20130912022800.GB260242@tornado.leadboat.com> <1378954642417-5770559.post@n5.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1378954642417-5770559.post@n5.nabble.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On Wed, Sep 11, 2013 at 07:57:22PM -0700, David Johnston wrote: > Noah Misch-2 wrote > > Making PGSharedMemoryCreate() pickier in all branches will greatly > > diminish > > the marginal value of preserving postmaster.pid, so I'm fine with dropping > > the > > postmaster.pid side of the proposal. > > Its probably still worth a fresh look at the immediate shutdown process to > see whether the current location where postmaster.pid is removed is > acceptable. It may not be necessary to leave it in place always but: > > 1) if there is a section of shared memory that can only be reached/found if > one knows the pid, and Similar: one needs a sysv shared memory key to find the segment, and postmaster.pid records that key. The chosen key is almost always the same from run to run, so a new postmaster typically does find the old segment even without postmaster.pid. > 2) postmaster.pid is removed before that area is "secured from future > clobbering" Clobbering shared memory is not the actual threat here. We use the shared memory segment as a witness to the fact that PostgreSQL processes are active in a data directory. If we let children of different postmasters operate in the same directory simultaneously, they can corrupt data. > then there may be a risk that can still be mitigated by moving its removal > without having to go to the extreme. -- Noah Misch EnterpriseDB http://www.enterprisedb.com -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers