Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id A66FBB5DBD2 for ; Tue, 26 Jul 2011 14:00:35 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 93160-05 for ; Tue, 26 Jul 2011 17:00:29 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from nm18-vm4.bullet.mail.ne1.yahoo.com (nm18-vm4.bullet.mail.ne1.yahoo.com [98.138.91.178]) by mail.postgresql.org (Postfix) with SMTP id 0B00CB5D91F for ; Tue, 26 Jul 2011 14:00:28 -0300 (ADT) Received: from [98.138.90.55] by nm18.bullet.mail.ne1.yahoo.com with NNFMP; 26 Jul 2011 17:00:26 -0000 Received: from [98.138.89.251] by tm8.bullet.mail.ne1.yahoo.com with NNFMP; 26 Jul 2011 17:00:26 -0000 Received: from [127.0.0.1] by omp1043.mail.ne1.yahoo.com with NNFMP; 26 Jul 2011 17:00:26 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 864066.77119.bm@omp1043.mail.ne1.yahoo.com Received: (qmail 45486 invoked by uid 60001); 26 Jul 2011 17:00:26 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1311699626; bh=scOBF+VNDe7gBI6Ujw4h6NeGbsG0BeM/Co/YNgXkf3o=; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=JVLDicSmiOVpXuqC+3TpQ3QE+/yIp03+CfReiRg5aaAqlaBIQA77U89SrxO9y9LTnLw5+xmklqkp74H/2XVQ5p5leYPiHq8/beJHm9ApM9JToAp+3y+HAvnUpwe83v41h7CCnkZGcDGhmsTnbRz/DGUMuBrg/4fytvvn9mrfZYQ= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=0AK3ea8PlnYiINrtEjmR9emmONLGzIA5hR90LR9AS5+lh0C53qq1CurnolgbC45F2hEvZc4fjwKc9iG4wLMm/KHSmTpIj3znGdjujIc3hJgktEfYb4VXu9V8xuZbR2HPu6E7C8FbpJ8ztU9eOO21j7S3Hp9sHJuExWEzzLpJcvc=; X-YMail-OSG: ssKiWk8VM1noGlDoLN1JiVCVNMK18CIU9f6i3eIWGgqbgZ9 sghY_gwvr3j0Qb2F_BdvNHTXuzLx6dWeCV1YAgq04OU4OHxa27VWEs3ssDw. kDsrjRIaU31d.qrkhI0AYQ.3Xr07rUP4KPUmnyphBDYG_W.QiyGzPoKqZXL4 oXZnytJaG80qBhJR6l.wbnfS0SWtyjEkxvDX6hwnlRnYXuOVcpl9IwBiBgoY PSOv5qpTxxdBw5v6tU39p6xXbc2sLTHYmFIaTUf3nErsrtqB6wnyC7OeULCy VQO14gBjrnAPSnChcjU8UCsfiKTPeRydiekJYTuWegoQkz1rS.ss- Received: from [64.61.91.74] by web120012.mail.ne1.yahoo.com via HTTP; Tue, 26 Jul 2011 10:00:26 PDT X-Mailer: YahooMailWebService/0.8.112.310352 Message-ID: <1311699626.15557.YahooMailNeo@web120012.mail.ne1.yahoo.com> Date: Tue, 26 Jul 2011 10:00:26 -0700 (PDT) From: A J Reply-To: A J Subject: Mechanics of streaming replication To: PG Admin MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-318791354-1311699626=:15557" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.369 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-1.191, SARE_SPEC_REPLICA=0.72 X-Spam-Level: X-Archive-Number: 201107/184 X-Sequence-Number: 37963 --0-318791354-1311699626=:15557 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hello,=0ATrying to understand the mechanics of streaming replication.=0AI u= nderstand that the WAL SENDER on primary streams to WAL RECEIVER on standby= . Also that depending on the settings, completed WAL files on the primary a= re sent to the archive directory. If needed, the standby will move the file= s from the archive directory to its wal directory (pg_xlog) and start apply= ing them to its data files.=0A=0AMy questions are:=0A1. Is it that the rest= ore command in the recovery.conf only controls when files get moved from ar= chive to the WAL directory on the standby ? If so, when does the restore co= mmand get kicked in ? Only at failover or whenever the connection between t= he primary and the standby is terminated ?=0A2. The archive directory conte= nts will always lag behind the current WAL on primary by 16MB (unless you t= weak archive_timeout parameter at the expense of bloating your archive stor= age). So in a typical setup, you always risk loosing up-to 16MB of committe= d data at failover. Right ? And I assume there is no way to reconcile this = 16MB automatically when the crashed ex-primary server comes up again. Right= ?=0A3. I don't think 'wal_keep_segments' has too much of a practical use. = It keeps the WALs in the pg_xlog directory of the primary which is local on= ly to primary. So in case of primary going down, all those WALs will be los= t to the standby. I guess most people primarily rely on 'archive_command' a= nd not wal_keep_segments, and use =A0Right ?=0AOr is it that it is preferre= d to keep wal_keep_segments high enough so that standby need not go to arch= ive directory every now and then ?=0A4. Does the standby switch-back from r= eading the archive to streaming once the connection between primary and sec= ondary is restored ?=0A=0AThanks for any inputs. --0-318791354-1311699626=:15557 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Hello,
Trying to understand the mechanics of streaming replication.
I u= nderstand that the WAL SENDER on primary streams to WAL RECEIVER on standby= . Also that depending on the settings, completed WAL files on the primary a= re sent to the archive directory. If needed, the standby will move the file= s from the archive directory to its wal directory (pg_xlog) and start apply= ing them to its data files.

My questions are:
1. Is it that the restore command in the recovery.conf only controls = when files get moved from archive to the WAL directory on the standby ? If = so, when does the restore command get kicked in ? Only at failover or whene= ver the connection between the primary and the standby is terminated ?
2. The archive directory contents will always lag behind the current WAL on primary by 16MB (unless you tweak archive_timeout parameter= at the expense of bloating your archive storage). So in a typical setup, y= ou always risk loosing up-to 16MB of committed data at failover. Right ? An= d I assume there is no way to reconcile this 16MB automatically when the cr= ashed ex-primary server comes up again. Right ?
3. I don't think = 'wal_keep_segments' has too much of a practical use. It keeps the WALs in t= he pg_xlog directory of the primary which is local only to primary. So in c= ase of primary going down, all those WALs will be lost to the standby. I gu= ess most people primarily rely on 'archive_command' and not wal_keep_segmen= ts, and use  Right ?
Or is it that it is preferred to keep w= al_keep_segments high enough so that standby need not go to archive directo= ry every now and then ?
4. Does the standby switch-back from read= ing the archive to streaming once the connection between primary and secondary is restored ?

Thanks for any inputs.
--0-318791354-1311699626=:15557--