Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YnprC-0008LR-3M for pgsql-admin@arkaria.postgresql.org; Thu, 30 Apr 2015 14:54:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YnprB-0003ZP-KD for pgsql-admin@arkaria.postgresql.org; Thu, 30 Apr 2015 14:54:29 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YnprA-0003ZF-R4 for pgsql-admin@postgresql.org; Thu, 30 Apr 2015 14:54:28 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1Ynpr3-0000dn-OA for pgsql-admin@postgresql.org; Thu, 30 Apr 2015 14:54:27 +0000 Received: from intern.anarazel.de (p5DDC6FA4.dip0.t-ipconnect.de [93.220.111.164]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id F4039860002; Thu, 30 Apr 2015 16:54:20 +0200 (CEST) Date: Thu, 30 Apr 2015 16:54:20 +0200 From: Andres Freund To: Scott Ribe Cc: Matt Patey , "pgsql-admin@postgresql.org" Subject: Re: Simultaneously streaming database replication and pg_dump, yet observing zero lag Message-ID: <20150430145420.GD2658@alap3.anarazel.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Pg-Spam-Score: -4.2 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org On 2015-04-30 08:08:22 -0600, Scott Ribe wrote: > On Apr 30, 2015, at 8:00 AM, Matt Patey wrote: > > > > We have a streaming replication setup, where the replication slave runs pg_dump every hour. Our lag monitor shows an expected sawtooth shape, where pg_dump runs coincide with a climbing lag, which ends abruptly when pg_dump is finished. This is, to the best of my knowledge, expected behaviour. The lag pattern occasionally disappears though, and when looking at system processes we see that the database is recovering WAL data, and pg_dump is also running. How is this even possible? > > Any query (and pg_dump is a series of queries) does not necessarily > block recovery. AFAIK, it’s only when the query requires a version of > a row which would be removed by WAL replay that the recovery gets > blocked. So it’s possible for pg_dump to not block recovery, but in > any reasonably active db I think it’s unlikely—exactly what you’re > seeing. Right. And incidences of thta can be greatly reduced by enabling hot_standby_feedback on the standby. Greetings, Andres Freund -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin