Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WhpgG-0001WC-DC for pgsql-hackers@arkaria.postgresql.org; Wed, 07 May 2014 00:25:52 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WhpgF-0006lo-JN for pgsql-hackers@arkaria.postgresql.org; Wed, 07 May 2014 00:25:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WhpgE-0006le-Bh for pgsql-hackers@postgresql.org; Wed, 07 May 2014 00:25:50 +0000 Received: from mout.kundenserver.de ([212.227.126.187]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Whpg6-0006RG-W0 for pgsql-hackers@postgresql.org; Wed, 07 May 2014 00:25:50 +0000 Received: from [10.1.0.2] (190.84.broadband17.iol.cz [109.80.84.190]) by mrelayeu.kundenserver.de (node=mreue007) with ESMTP (Nemesis) id 0Ly7gf-1Wvrtv2cpJ-015e1s; Wed, 07 May 2014 02:25:39 +0200 Message-ID: <53697D84.1050103@2ndquadrant.com> Date: Wed, 07 May 2014 02:25:40 +0200 From: Petr Jelinek User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Robert Haas CC: Craig Ringer , Andres Freund , Tom Lane , Antonin Houska , "pgsql-hackers@postgresql.org" , Abhijit Menon-Sen Subject: Re: bgworker crashed or not? References: <20140416131052.GG17874@awork2.anarazel.de> <20140416152803.GJ17874@awork2.anarazel.de> <20140416154412.GL17874@awork2.anarazel.de> <27214.1397663665@sss.pgh.pa.us> <20140416160047.GM17874@awork2.anarazel.de> <20140416161143.GN17874@awork2.anarazel.de> <20140416162837.GO17874@awork2.anarazel.de> <534EEC61.7000006@2ndquadrant.com> <534F21E6.7080705@2ndquadrant.com> <5358A38F.50808@2ndquadrant.com> <535EB7CB.3020807@2ndquadrant.com> <5366474D.4060408@2ndquadrant.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:4NJWtysW+kJN4x7yHq6IjwKCP7c+gLQ6pMqISsBCrt4 RQJYhBrG3UUiy+svdX/ulr9ruYabgQsSTQrh43YgVFJnGm7ysQ okGmxndWLOX0rKFbqZDU0QnFI4W8ay54kInQh7Obgmsb3IMMrX yO07ej48Tw3X+wDzcb3JOQ+32J97bXw3Uug/PDCxVAcRrAkZ+o z7D+6oNPOPX7iKjlGdbbqNkiZlaTVPx4MywJ/gU16mLBN9yYv8 +i5fmUt6TdzFeOoS/0KJ7TUzg1Un8W5vR3Tnfd56nhvaeZxTyE 8DTJmtLjo2rLmXkGotoVqOPo30w3PaDwEflnn0U19YqJLAE1OE D/jjimnCJLK7hH1hw2WkGFXGjrjeRhV715JJK0DJQ X-Pg-Spam-Score: -1.9 (-) 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 06/05/14 19:05, Robert Haas wrote: > Which brings up another point: the behavior of non-shmem-connected > workers is totally bizarre. An exit status other than 0 or 1 is not > treated as a crash requiring a restart, but failure to disengage the > deadman switch is still treated as a crash requiring a restart. Why? > If the workers are not shmem-connected, then no crash requires a > system-wide restart. Of course, there's the tiny problem that we > aren't actually unmapping shared memory from supposedly non-shmem > connected workers, which is a different bug, but ignoring that for the > moment there's no reason for this logic to be like this. Agreed. > What I'm inclined to do is change the logic so that: > > (1) After a crash-and-restart sequence, zero rw->rw_crashed_at, so > that anything which is still registered gets restarted immediately. Yes, that's quite obvious change which I missed completely :). > (2) If a shmem-connected backend fails to release the deadman switch > or exits with an exit code other than 0 or 1, we crash-and-restart. A > non-shmem-connected backend never causes a crash-and-restart. +1 > (3) When a background worker exits without triggering a > crash-and-restart, an exit code of precisely 0 causes the worker to be > unregistered; any other exit code has no special effect, so > bgw_restart_time controls. +1 -- Petr Jelinek http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers