Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Ynp8h-00065y-8t for pgsql-admin@arkaria.postgresql.org; Thu, 30 Apr 2015 14:08:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Ynp8g-0006cn-KE for pgsql-admin@arkaria.postgresql.org; Thu, 30 Apr 2015 14:08:30 +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 1Ynp8f-0006ch-Rt for pgsql-admin@postgresql.org; Thu, 30 Apr 2015 14:08:30 +0000 Received: from mailout.easymail.ca ([64.68.201.169]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Ynp8c-0008Aa-Pq for pgsql-admin@postgresql.org; Thu, 30 Apr 2015 14:08:28 +0000 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id EECDDE1FF; Thu, 30 Apr 2015 10:08:24 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at mailout.easymail.ca X-Spam-Flag: NO X-Spam-Score: -3.392 X-Spam-Level: X-Spam-Status: No, score=-3.392 required=5 tests=[ALL_TRUSTED=-1.8, AWL=-0.726, BAYES_00=-2.599, DNS_FROM_AHBL_RHSBL=0.692, FS_REPLICA=1.041] Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (easymail-mailout.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id r0K96YUjEJPq; Thu, 30 Apr 2015 10:08:24 -0400 (EDT) Received: from [192.168.2.16] (unknown [8.39.228.5]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 626B7E1F9; Thu, 30 Apr 2015 10:08:24 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: Simultaneously streaming database replication and pg_dump, yet observing zero lag From: Scott Ribe In-Reply-To: Date: Thu, 30 Apr 2015 08:08:22 -0600 Cc: "pgsql-admin@postgresql.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Matt Patey X-Mailer: Apple Mail (2.2098) X-Pg-Spam-Score: -2.6 (--) 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 Apr 30, 2015, at 8:00 AM, Matt Patey wrote: >=20 > We have a streaming replication setup, where the replication slave runs p= g_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 pro= cesses 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 r= ecovery. AFAIK, it=E2=80=99s only when the query requires a version of a ro= w which would be removed by WAL replay that the recovery gets blocked. So i= t=E2=80=99s possible for pg_dump to not block recovery, but in any reasonab= ly active db I think it=E2=80=99s unlikely=E2=80=94exactly what you=E2=80= =99re seeing. --=20 Scott Ribe scott_ribe@elevated-dev.com http://www.elevated-dev.com/ https://www.linkedin.com/in/scottribe/ (303) 722-0567 voice --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin