Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 00B8AB5DBDE for ; Thu, 30 Jun 2011 09:50:14 -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 45786-02 for ; Thu, 30 Jun 2011 12:50:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-fx0-f47.google.com (mail-fx0-f47.google.com [209.85.161.47]) by mail.postgresql.org (Postfix) with ESMTP id 6446CB5DBD0 for ; Thu, 30 Jun 2011 09:50:07 -0300 (ADT) Received: by fxg11 with SMTP id 11so2461150fxg.34 for ; Thu, 30 Jun 2011 05:50:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; bh=Lqi4rx1GpK1qG25Jdt8A2IKrLaGidG932WJ3wLuOY9c=; b=SZBhAy9uegxJR+LITl7h6gQsnbyPNKoWLEXm/Vu9usUPi0wZ3/C3KoNM1kXMJl4RF7 tKBS41dCye0RlNUonfpyYc88EUSEWnqzC3toTbX/81mKAjQDosfygWDNOM5FORDF5xEb xMf0T2g0MDKogyDcyxCoA/QWPqeiLxsmukP7c= Received: by 10.223.32.142 with SMTP id c14mr2942542fad.59.1309438207148; Thu, 30 Jun 2011 05:50:07 -0700 (PDT) Received: from [192.168.1.41] ([92.45.120.87]) by mx.google.com with ESMTPS id h28sm1589908faj.29.2011.06.30.05.50.05 (version=SSLv3 cipher=OTHER); Thu, 30 Jun 2011 05:50:05 -0700 (PDT) Subject: Re: Problem with Streaming Replication From: Kerem Can =?UTF-8?Q?Karaka=C5=9F?= To: abraao895 Cc: pgsql-admin@postgresql.org In-Reply-To: <1309436503938-4538638.post@n5.nabble.com> References: <1309436503938-4538638.post@n5.nabble.com> Content-Type: text/plain; charset="UTF-8" Date: Thu, 30 Jun 2011 15:50:03 +0300 Message-ID: <1309438203.2138.24.camel@kerem-ThinkPad> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.42 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, FS_REPLICA=3.599, SARE_SPEC_REPLICA=0.72 X-Spam-Level: ** X-Archive-Number: 201106/151 X-Sequence-Number: 37777 On Thu, 2011-06-30 at 05:21 -0700, abraao895 wrote: > Hi, > > I have a doubt about the WAL-based replication. Suppose this situation: > > - The PC1(master) write the WAL file in the shared folder in her HD. > > - The HD of the PC1(master) dead. The WAL file don't have replicated because > 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. > > - The PC2(slave) doesn't have the last record. Streaming replication occurs on transaction basis. As taken form the documentation on http://www.postgresql.org/docs/9.0/static/warm-standby.html "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, which streams WAL records to the standby as they're generated, without waiting for the WAL file to be filled. " 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, it is on the disk of the slave server anyway.