Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id C798CB5DBC9 for ; Thu, 30 Jun 2011 10:26:18 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 22420-03 for ; Thu, 30 Jun 2011 13:26:12 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from bay0-omc3-s20.bay0.hotmail.com (bay0-omc3-s20.bay0.hotmail.com [65.54.190.158]) by mail.postgresql.org (Postfix) with ESMTP id B2683B5DC1F for ; Thu, 30 Jun 2011 10:26:11 -0300 (ADT) Received: from BAY145-W23 ([65.54.190.189]) by bay0-omc3-s20.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 30 Jun 2011 06:26:10 -0700 Message-ID: Content-Type: multipart/alternative; boundary="_9d5d0deb-e4a0-4f4d-b2af-b315c12f1aed_" X-Originating-IP: [189.107.98.183] From: =?iso-8859-1?B?QWJyYeNvIEZlcnJlaXJh?= To: CC: Subject: Re: Problem with Streaming Replication Date: Thu, 30 Jun 2011 10:26:09 -0300 Importance: Normal In-Reply-To: <1309438203.2138.24.camel@kerem-ThinkPad> References: <1309436503938-4538638.post@n5.nabble.com>, <1309438203.2138.24.camel@kerem-ThinkPad> MIME-Version: 1.0 X-OriginalArrivalTime: 30 Jun 2011 13:26:10.0346 (UTC) FILETIME=[4688D0A0:01CC3729] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=4.44 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=0.1, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1.929, FS_REPLICA=3.599, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SARE_SPEC_REPLICA=0.72, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: **** X-Archive-Number: 201106/152 X-Sequence-Number: 37778 --_9d5d0deb-e4a0-4f4d-b2af-b315c12f1aed_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Kerem=2C Thanks to your answer. I think that the correct way is: 1) The master write in her hard drive the WAL files.=20 2) After this in some moment(asynchronous method)=2C the slave node connect= in the shared folder(master) and copy to it all the WAL files. 3) After the slave execute the copy=2C this execute the instructions inside= the WAL files to her database. My doubt is if the master hd is dead after write some transactions in h= er WAL before the (2) step happen. In this case i think that the data goig = to be lost. And i would like to know if there is a mode of 'force' replicat= e the WAL file to the slave using some command. Abra=E3o >Subject: Re: [ADMIN] Problem with Streaming Replication > From: blokdiyagram@gmail.com > To: abraao895@hotmail.com > CC: pgsql-admin@postgresql.org > Date: Thu=2C 30 Jun 2011 15:50:03 +0300 >=20 > On Thu=2C 2011-06-30 at 05:21 -0700=2C abraao895 wrote: > > Hi=2C > >=20 > > I have a doubt about the WAL-based replication. Suppose this situation: > >=20 > > - The PC1(master) write the WAL file in the shared folder in her HD. > >=20 > > - The HD of the PC1(master) dead. The WAL file don't have replicated be= cause > > it is a asynchronous proccess and suppose that this already didn't have > > happened. > This is unlikely to happen when you share the folder of the slave server > to the master as the WAL backup folder. > >=20 > > - The PC2(slave) doesn't have the last record. > Streaming replication occurs on transaction basis. As taken form the > documentation on=20 > http://www.postgresql.org/docs/9.0/static/warm-standby.html >=20 > "Streaming replication allows a standby server to stay more up-to-date > than is possible with file-based log shipping. The standby connects to > the primary=2C which streams WAL records to the standby as they're > generated=2C without waiting for the WAL file to be filled. " >=20 > So as soon as it is written on WAL on the master server it is written > also on the slave node. The shared WAL folder is there in case the slave > cannot keep up with the master server. Usually on such a situation it > should not use immediately the WAL logs to keep up. If it happens to use > wal at a particular time=2C it is on the disk of the slave server anyway. >=20 >=20 = --_9d5d0deb-e4a0-4f4d-b2af-b315c12f1aed_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi= Kerem=2C
 =3B  =3B =3B Thanks to your answer. I think that = the correct way is:

1) The master write in her hard drive the WAL fi= les.

2) After this in some moment(asynchronous method)=2C the slave= node connect in the shared folder(master) and copy to it all the WAL files= .

3) After the slave execute the copy=2C this execute the instructio= ns inside the WAL files to her database.

 =3B  =3B My doubt = is if the master hd is dead after write some transactions in her WAL before= the (2) step happen. In this case i think that the data goig to be lost. A= nd i would like to know if there is a mode of 'force' replicate the WAL fil= e to the slave using some command.

Abra=E3o

>=3BSubjec= t: Re: [ADMIN] Problem with Streaming Replication
>=3B From: blokdiyag= ram@gmail.com
>=3B To: abraao895@hotmail.com
>=3B CC: pgsql-admin= @postgresql.org
>=3B Date: Thu=2C 30 Jun 2011 15:50:03 +0300
>=3B=
>=3B On Thu=2C 2011-06-30 at 05:21 -0700=2C abraao895 wrote:
>= =3B >=3B Hi=2C
>=3B >=3B
>=3B >=3B I have a doubt about th= e WAL-based replication. Suppose this situation:
>=3B >=3B
>= =3B >=3B - The PC1(master) write the WAL file in the shared folder in her= HD.
>=3B >=3B
>=3B >=3B - The HD of the PC1(master) dead. T= he WAL file don't have replicated because
>=3B >=3B it is a asynchro= nous proccess and suppose that this already didn't have
>=3B >=3B ha= ppened.
>=3B This is unlikely to happen when you share the folder of t= he slave server
>=3B to the master as the WAL backup folder.
>=3B= >=3B
>=3B >=3B - The PC2(slave) doesn't have the last record.>=3B Streaming replication occurs on transaction basis. As taken form th= e
>=3B documentation on
>=3B http://www.postgresql.org/docs/9.0/= static/warm-standby.html
>=3B
>=3B "Streaming replication allows= a standby server to stay more up-to-date
>=3B than is possible with f= ile-based log shipping. The standby connects to
>=3B the primary=2C wh= ich streams WAL records to the standby as they're
>=3B generated=2C wi= thout waiting for the WAL file to be filled. "
>=3B
>=3B So as s= oon as it is written on WAL on the master server it is written
>=3B al= so on the slave node. The shared WAL folder is there in case the slave
&= gt=3B cannot keep up with the master server. Usually on such a situation it=
>=3B should not use immediately the WAL logs to keep up. If it happen= s to use
>=3B wal at a particular time=2C it is on the disk of the sla= ve server anyway.
>=3B
>=3B
= --_9d5d0deb-e4a0-4f4d-b2af-b315c12f1aed_--