Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 81ED7DE314A for ; Tue, 3 Apr 2012 03:50:10 -0300 (ADT) Received: from exprod7og125.obsmtp.com ([64.18.2.28]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SExZ8-0008Fa-6E for pgsql-bugs@postgresql.org; Tue, 03 Apr 2012 06:50:09 +0000 Received: from mail-bk0-f51.google.com ([209.85.214.51]) (using TLSv1) by exprod7ob125.postini.com ([64.18.6.12]) with SMTP ID DSNKT3qdkE87ApCQvxHtmmUTbvI8n46ZIUUq@postini.com; Mon, 02 Apr 2012 23:50:05 PDT Received: by bkwj10 with SMTP id j10so2937119bkw.10 for ; Mon, 02 Apr 2012 23:49:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=IxI3eSc8p36B86X8ABEyKOEp8b1Z9ATpkHI6kFueWLA=; b=jaRhNI3NoTlALziAFg+FZb6oCyyCONgLxjEFNkMieSSRd8XVSLzW39T21o64eSzy/D 4aWnZYOH4lVXlqw4lVvNsax1v+dZoNGErzNiWXEgDOQjrnN6HRYwsC+4DWcPna4DyeSB T8huRMU6/lmjAumzVufEfuWHG84g3LzuUIP8FDbC96G15dSFRQirQkKEceFkJJk53gJ1 7XjWPYa9dTnu80Y3fpAhE2lfI8ebszPoA+1uxQZewIaOmCM2ABu/6t+VpOP2qpF6CivA MzOfwHgfg6wyNVXGpmE2dSqu7nHa9x+m8igwjPoZ6QXiZzxwr5qbCeULL8mayNC144gQ cnBg== Received: by 10.204.157.12 with SMTP id z12mr4791427bkw.135.1333435791102; Mon, 02 Apr 2012 23:49:51 -0700 (PDT) Received: from [10.40.4.68] ([80.249.134.99]) by mx.google.com with ESMTPS id jd17sm43346747bkb.4.2012.04.02.23.49.48 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 02 Apr 2012 23:49:49 -0700 (PDT) Message-ID: <4F7A9D87.9060708@enterprisedb.com> Date: Tue, 03 Apr 2012 09:49:43 +0300 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.3) Gecko/20120324 Icedove/10.0.3 MIME-Version: 1.0 To: amatzinger@experts-exchange.com CC: pgsql-bugs@postgresql.org Subject: Re: BUG #6571: Postgres Kills 'Select 1' query randomly on hot standby databases References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQlu3UdesiAWDTlTBp4iwgLalIASO9kwcBG8f1PRaqpHxoSQYOO1aIqGRFJtQs65Fc5fFbrM X-Pg-Spam-Score: -4.2 (----) X-Archive-Number: 201204/9 X-Sequence-Number: 32760 On 03.04.2012 02:23, amatzinger@experts-exchange.com wrote: > On a hot standby database, while the primary is being updated, Postgres will > randomly kill a process which is performing a "Select 1" command. > > The error is this: > 2012-04-02 13:36:13.269 > PDT,"smxuser","smxprd1",39523,"127.0.0.1:57893",4f79ffad.9a63,1,"",2012-04-02 > 12:36:13 PDT,3/32,0,FATAL,40001,"terminating connection due to conflict with > recovery","User query might have needed to see row versions that must be > removed.","In a moment you should be able to reconnect to the database and > repeat your command.",,,,,,,"" > > We have 5 hot standby's set up, which all preform this SELECT 1, and > postgres kills them across all standby's. > > There should never be a situation that SELECT 1 is in conflict with data, as > it it never using any table in the database. The system doesn't make a difference between queries like "SELECT 1" that don't access any tables, and those that do. Even if "SELECT 1" doesn't access any tables, a subsequent statement in the same transaction might. I'm assuming that those "SELECT 1"s were issued in transactions that had been open for a long time, because you shouldn't get recovery conflicts with very short transactions, in practice anyway. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com