From postgres@kiwi-fraser.net Fri Aug 3 23:19:11 2007 Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id C5E6C9FB45A for ; Fri, 3 Aug 2007 20:19:11 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 32035-08 for ; Fri, 3 Aug 2007 20:18:58 -0300 (ADT) X-Greylist: delayed 00:18:24.398697 by SQLgrey-1.7.5 Received: from smtp-out5.blueyonder.co.uk (smtp-out5.blueyonder.co.uk [195.188.213.8]) by postgresql.org (Postfix) with ESMTP id ACFCE9FB35E for ; Fri, 3 Aug 2007 20:19:08 -0300 (ADT) Received: from [172.23.170.136] (helo=anti-virus01-07) by smtp-out5.blueyonder.co.uk with smtp (Exim 4.52) id 1IH68Q-00030m-L5 for pgsql-admin@postgresql.org; Sat, 04 Aug 2007 00:00:42 +0100 Received: from [82.44.23.191] (helo=demolish1) by asmtp-out4.blueyonder.co.uk with smtp (Exim 4.52) id 1IH68Q-0003Tb-5f for pgsql-admin@postgresql.org; Sat, 04 Aug 2007 00:00:42 +0100 Message-ID: <008601c7d622$244237a0$b464a8c0@demolish1> From: "Donald Fraser" To: "[ADMIN]" Subject: WAL segment question Date: Sat, 4 Aug 2007 00:00:52 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0083_01C7D62A.85E2EB00" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.243 tagged_above=0 required=5 tests=AWL=0.241, BAYES_50=0.001, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200708/24 X-Sequence-Number: 26355 This is a multi-part message in MIME format. ------=_NextPart_000_0083_01C7D62A.85E2EB00 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Our company has two sites, a master and a disaster recovery site. I am trying to assess whether data has been lost during a fail-over, due = to the asynchronous method of transporting WAL file data between sites = (we use DRBD). Disaster recovery node start-up log: user=3D pid=3D9907 timestamp=3D[2007-08-01 17:09:51 BST] tid=3D LOG: = record with zero length at 0/7C62F52C user=3D pid=3D9907 timestamp=3D[2007-08-01 17:09:51 BST] tid=3D LOG: = redo done at 0/7C62F4E8 My question is: given the above WAL segment information, can I use it to = decide whether information was lost in the master database site, at the = point of failure, without starting the database up? Regards Donald Fraser. ------=_NextPart_000_0083_01C7D62A.85E2EB00 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Our company has two sites, a master and a disaster = recovery=20 site.
I am trying to assess whether data has been lost = during a=20 fail-over, due to the asynchronous method of transporting WAL file=20 data between sites (we use DRBD).
 
Disaster recovery node start-up log:
user=3D pid=3D9907 timestamp=3D[2007-08-01 17:09:51 = BST] tid=3D=20 LOG:  record with zero length at 0/7C62F52C
user=3D pid=3D9907=20 timestamp=3D[2007-08-01 17:09:51 BST] tid=3D LOG:  redo done at=20 0/7C62F4E8
 
My question is: given the = above WAL=20 segment information, can I use it to decide whether information was lost = in the=20 master database site, at the point of = failure, without=20 starting the database up?
 
Regards
Donald Fraser.
 
 
------=_NextPart_000_0083_01C7D62A.85E2EB00-- From decibel@decibel.org Sat Aug 4 00:21:30 2007 Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id C465B9FBDDE for ; Fri, 3 Aug 2007 21:21:30 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 25050-10 for ; Fri, 3 Aug 2007 21:21:20 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id 3D8D89FB6AF for ; Fri, 3 Aug 2007 21:21:27 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id 1784556453; Fri, 3 Aug 2007 19:21:26 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Fri, 3 Aug 2007 19:21:24 -0500 Date: Fri, 3 Aug 2007 19:21:24 -0500 From: Decibel! To: Donald Fraser Cc: "[ADMIN]" Subject: Re: WAL segment question Message-ID: <20070804002124.GD25704@nasby.net> References: <008601c7d622$244237a0$b464a8c0@demolish1> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EH85xkKza2NXtwkF" Content-Disposition: inline In-Reply-To: <008601c7d622$244237a0$b464a8c0@demolish1> X-Operating-System: FreeBSD 6.1-RELEASE-p10 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.13 (2006-08-11) X-Hashcash: 1:20:070804:postgres@kiwi-fraser.net::V/4ingOHcVFTtIHN:0000000000000 0000000000000000000000000/7r X-Hashcash: 1:20:070804:pgsql-admin@postgresql.org::rtusOwsEn9NSXVLU:00000000000 0000000000000000000000001Rph X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/28 X-Sequence-Number: 26359 --EH85xkKza2NXtwkF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Aug 04, 2007 at 12:00:52AM +0100, Donald Fraser wrote: > Our company has two sites, a master and a disaster recovery site. > I am trying to assess whether data has been lost during a fail-over, due = to the asynchronous method of transporting WAL file data between sites (we = use DRBD). >=20 > Disaster recovery node start-up log: > user=3D pid=3D9907 timestamp=3D[2007-08-01 17:09:51 BST] tid=3D LOG: rec= ord with zero length at 0/7C62F52C > user=3D pid=3D9907 timestamp=3D[2007-08-01 17:09:51 BST] tid=3D LOG: red= o done at 0/7C62F4E8 >=20 > My question is: given the above WAL segment information, can I use it to = decide whether information was lost in the master database site, at the poi= nt of failure, without starting the database up? I'm not sure, but you could try md5-ing the appropriate WAL file on the master and slave; if the files are identical then you shouldn't have lost any data... if they are then you probably have. --=20 Decibel!, aka Jim Nasby decibel@decibel.org EnterpriseDB http://enterprisedb.com 512.569.9461 (cell) --EH85xkKza2NXtwkF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.3 (FreeBSD) iD8DBQFGs8aEdO30qud8SkgRAicBAJ4qmXdxV8uGSDPy7VXVXnXfryoMPACeLj3z gzEje2wIWOEGv700bYTesgQ= =sYEU -----END PGP SIGNATURE----- --EH85xkKza2NXtwkF-- From simon@2ndquadrant.com Sun Aug 5 20:57:50 2007 Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 8929B9FB546 for ; Sun, 5 Aug 2007 17:57:50 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 32397-07 for ; Sun, 5 Aug 2007 17:57:47 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail01.enterprisedb.com (mail01.enterprisedb.com [63.246.7.168]) by postgresql.org (Postfix) with ESMTP id 472039FB509 for ; Sun, 5 Aug 2007 17:57:47 -0300 (ADT) thread-index: AcfXo05GuDWMGKK+RKKfeNpyO48FPA== Content-Class: urn:content-classes:message Received: from [192.168.0.5] ([81.6.216.155]) by mail01.enterprisedb.com with Microsoft SMTPSVC(6.0.3790.3959); Sun, 5 Aug 2007 16:57:59 -0400 Importance: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4073 Subject: Re: WAL segment question From: "Simon Riggs" To: "Donald Fraser" Cc: "[ADMIN]" In-Reply-To: <008601c7d622$244237a0$b464a8c0@demolish1> References: <008601c7d622$244237a0$b464a8c0@demolish1> Content-Type: text/plain; charset="iso-8859-1" Date: Sun, 05 Aug 2007 21:58:49 +0100 Message-ID: <1186347529.4146.6.camel@ebony.site> MIME-Version: 1.0 X-Mailer: Evolution 2.8.2 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 05 Aug 2007 20:57:59.0343 (UTC) FILETIME=[4E1BBBF0:01C7D7A3] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/29 X-Sequence-Number: 26360 On Sat, 2007-08-04 at 00:00 +0100, Donald Fraser wrote: > Our company has two sites, a master and a disaster recovery site. > I am trying to assess whether data has been lost during a fail-over, > due to the asynchronous method of transporting WAL file data between > sites (we use DRBD). > > Disaster recovery node start-up log: > user= pid=9907 timestamp=[2007-08-01 17:09:51 BST] tid= LOG: record > with zero length at 0/7C62F52C > user= pid=9907 timestamp=[2007-08-01 17:09:51 BST] tid= LOG: redo > done at 0/7C62F4E8 > > My question is: given the above WAL segment information, can I use it > to decide whether information was lost in the master database site, at > the point of failure, without starting the database up? Currently there is no built-in means of finding out the time of the last record transferred, if the primary stays down. You need to use xlogdump to locate the time of the last commit/abort record. -- Simon Riggs EnterpriseDB http://www.enterprisedb.com From chander@otg-nc.com Mon Aug 6 22:54:35 2007 Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id D00E99FB583 for ; Mon, 6 Aug 2007 19:54:35 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 62560-01 for ; Mon, 6 Aug 2007 19:54:21 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from smtp132.iad.emailsrvr.com (smtp132.iad.emailsrvr.com [207.97.245.132]) by postgresql.org (Postfix) with ESMTP id 2F6DD9FB560 for ; Mon, 6 Aug 2007 19:54:25 -0300 (ADT) Received: by relay3.r3.iad.emailsrvr.com (Authenticated sender: chander-AT-otg-nc.com) with ESMTP id 1C80C44C081; Mon, 6 Aug 2007 18:54:23 -0400 (EDT) Message-ID: <46B7A6A6.9010401@otg-nc.com> Date: Mon, 06 Aug 2007 18:54:30 -0400 From: Chander Ganesan User-Agent: Thunderbird 2.0.0.5 (Windows/20070716) MIME-Version: 1.0 To: Donald Fraser CC: "[ADMIN]" Subject: Re: WAL segment question References: <008601c7d622$244237a0$b464a8c0@demolish1> In-Reply-To: <008601c7d622$244237a0$b464a8c0@demolish1> Content-Type: multipart/alternative; boundary="------------080200040604050004000500" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/33 X-Sequence-Number: 26364 This is a multi-part message in MIME format. --------------080200040604050004000500 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Donald Fraser wrote: > Our company has two sites, a master and a disaster recovery site. > I am trying to assess whether data has been lost during a fail-over, > due to the asynchronous method of transporting WAL file data between > sites (we use DRBD). > > Disaster recovery node start-up log: > user= pid=9907 timestamp=[2007-08-01 17:09:51 BST] tid= LOG: record > with zero length at 0/7C62F52C > user= pid=9907 timestamp=[2007-08-01 17:09:51 BST] tid= LOG: redo > done at 0/7C62F4E8 > > My question is: given the above WAL segment information, can I use it > to decide whether information was lost in the master database site, at > the point of failure, without starting the database up? > > Regards > Donald Fraser. DRBD is a synchronous method of transferring data - it's not asynchronous. Assuming you are using Protocol C you should find that both are always in sync. If you are using protocol B then things will be in sync so long as the remote system didn't crash, and if you are using Protocol A then things should be in sync as long as the local system didn't crash. -- Chander Ganesan Open Technology Group, Inc. One Copley Parkway, Suite 210 Morrisville, NC 27560 919-463-0999/866-229-3386 http://www.otg-nc.com --------------080200040604050004000500 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Donald Fraser wrote:
Our company has two sites, a master and a disaster recovery site.
I am trying to assess whether data has been lost during a fail-over, due to the asynchronous method of transporting WAL file data between sites (we use DRBD).
 
Disaster recovery node start-up log:
user= pid=9907 timestamp=[2007-08-01 17:09:51 BST] tid= LOG:  record with zero length at 0/7C62F52C
user= pid=9907 timestamp=[2007-08-01 17:09:51 BST] tid= LOG:  redo done at 0/7C62F4E8
 
My question is: given the above WAL segment information, can I use it to decide whether information was lost in the master database site, at the point of failure, without starting the database up?
 
Regards
Donald Fraser.
DRBD is a synchronous method of transferring data - it's not asynchronous.  Assuming you are using Protocol C you should find that both are always in sync.  If you are using protocol B then things will be in sync so long as the remote system didn't crash, and if you are using Protocol A then things should be in sync as long as the local system didn't crash.
-- 
Chander Ganesan
Open Technology Group, Inc.
One Copley Parkway, Suite 210
Morrisville, NC  27560
919-463-0999/866-229-3386
http://www.otg-nc.com
--------------080200040604050004000500-- From postgres@kiwi-fraser.net Mon Aug 6 23:59:24 2007 Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 5CD5C9FB52E for ; Mon, 6 Aug 2007 20:59:24 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 83085-09 for ; Mon, 6 Aug 2007 20:59:13 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from smtp-out2.blueyonder.co.uk (smtp-out2.blueyonder.co.uk [195.188.213.5]) by postgresql.org (Postfix) with ESMTP id C3D169FB4E6 for ; Mon, 6 Aug 2007 20:59:20 -0300 (ADT) Received: from [172.23.170.140] (helo=anti-virus02-07) by smtp-out2.blueyonder.co.uk with smtp (Exim 4.52) id 1IICTm-0003s1-IT for pgsql-admin@postgresql.org; Tue, 07 Aug 2007 00:59:18 +0100 Received: from [82.44.23.191] (helo=demolish1) by asmtp-out6.blueyonder.co.uk with smtp (Exim 4.52) id 1IICTm-0008Tw-23 for pgsql-admin@postgresql.org; Tue, 07 Aug 2007 00:59:18 +0100 Message-ID: <00f201c7d885$d50a9900$b464a8c0@demolish1> From: "Donald Fraser" To: "[ADMIN]" References: <008601c7d622$244237a0$b464a8c0@demolish1> <46B7A6A6.9010401@otg-nc.com> Subject: Re: WAL segment question Date: Tue, 7 Aug 2007 00:59:31 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/35 X-Sequence-Number: 26366 ----- Original Message ----- From: Chander Ganesan > DRBD is a synchronous method of transferring data - it's not asynchronous. Assuming you are using Protocol C you should find that both are always in sync. If you are using protocol B then things will be in sync so long as the remote system didn't crash, and if you are using Protocol A then things should be in sync as long as the local system didn't crash. Apologies if you thought I was insinuating DRBD is categorically asynchronous. But you assumed wrong, we use protocol A, because we don't have a fast WAN link < 10Mbps. According to the DRBD documentation: Protocol A: write IO is reported as completed, if it has reached local disk and local tcp send buffer. Which I interpret as: A for Asynchronous, which means I can complete writing data and start writing the next set of data before the first set of data has been synchronised at the remote site. This is the cost of our system - we are willing to loose data for improved performance of our master server. We've had one failure in 7 years that I've been at the company... Many thanks to Linux and more importantly PostgreSQL! One day when our local telecomms company stop the monopoly on leased data lines, we may upgrade our DR link to a 100Mbps or even 1Gbps link, in which case, protocol B or C will be a better solution. Unfortunately I think there's a better chance that the cost of postage will go down first.