Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 4799F133655C for ; Tue, 8 Feb 2011 20:24:37 -0400 (AST) 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 59136-09 for ; Wed, 9 Feb 2011 00:24:29 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-iw0-f174.google.com (mail-iw0-f174.google.com [209.85.214.174]) by mail.postgresql.org (Postfix) with ESMTP id E69E61337B8A for ; Tue, 8 Feb 2011 20:24:28 -0400 (AST) Received: by iwn9 with SMTP id 9so6304427iwn.19 for ; Tue, 08 Feb 2011 16:24:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:references:in-reply-to:subject:date :message-id:mime-version:content-type:content-transfer-encoding :x-mailer:thread-index:content-language; bh=t19N333ayB40b07xawYR6Hm+vVB0Z6wsXslJZ0r3gio=; b=u+nP1jV8NDLFJ4N5z0GuRRU4o1HdMx8UY+l11KpZG+xhWqWpM4R+FmzW7WKiHQvrpu 4WQ3sMSeSLY6eH70I3Fw2u7ODOOHvePVLEcVraumGai/74yKs+FwbyINPcNO6TZA4PQ9 V378H4uXN+N7RuLwYzNIJd5Xn27Cy3z/UKGk8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:references:in-reply-to:subject:date:message-id :mime-version:content-type:content-transfer-encoding:x-mailer :thread-index:content-language; b=xdeNBYPxdHJwRnmAub+pYwUq3bBDupvLuMhsSZ+XcCX+kDpwj/s5vRaDbS4A4Vqp+V wKQOC7pZnu9J4LS6A4gUvJM2FdySBoJ9xVk0SOygyldYD6xyZXN8h6J5YccdZFve2Z3t eozgAwMNLqQxCVJJMqY/6UQpOGc8YybxkLwZ0= Received: by 10.42.228.202 with SMTP id jf10mr21542054icb.19.1297211067882; Tue, 08 Feb 2011 16:24:27 -0800 (PST) Received: from Duality (174-29-75-73.hlrn.qwest.net [174.29.75.73]) by mx.google.com with ESMTPS id i16sm83315ibl.18.2011.02.08.16.24.25 (version=SSLv3 cipher=OTHER); Tue, 08 Feb 2011 16:24:26 -0800 (PST) From: "mark" To: "'Fujii Masao'" Cc: "'Robert Haas'" , References: <201101270124.p0R1OIpY051049@wwwmaster.postgresql.org> <034301cbbf15$bc078920$34169b60$@com> <041001cbc0b6$3b4f3a60$b1edaf20$@com> In-Reply-To: Subject: Re: BUG #5851: ROHS (read only hot standby) needs to be restarted manually in somecases. Date: Tue, 8 Feb 2011 17:23:16 -0700 Message-ID: <058b01cbc7ef$8cfaa9e0$a6effda0$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcvH4+E031p4G0EtTrOCB1a/+mWOPQAAbTCg Content-Language: en-us X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7 X-Spam-Level: X-Archive-Number: 201102/79 X-Sequence-Number: 29351 > -----Original Message----- > From: Fujii Masao [mailto:masao.fujii@gmail.com] > Sent: Tuesday, February 08, 2011 4:00 PM > To: mark > Cc: Robert Haas; pgsql-bugs@postgresql.org > Subject: Re: [BUGS] BUG #5851: ROHS (read only hot standby) needs to be > restarted manually in somecases. > > On Wed, Feb 9, 2011 at 6:36 AM, mark wrote: > > this is the recovery.conf file, see any problems with it? maybe I > > didn't do some syntax right right ? > > > > [postgres@ data9.0]$ cat recovery.conf > > standby_mode = 'on' > > primary_conninfo = 'host= port=5432 user=postgres > > keepalives_idle=30 keepalives_interval=30 keepalives_count=30' > > This setting would lead TCP keepalive to take about 930 seconds > (= 30 + 30 * 30) to detect the network outage. If you want to stop > replication as soon as the outage happens, you need to decrease > the keepalive setting values. What numbers would you suggest? I have been guessing and probably doing a very poor job of it. I am turning knobs and not getting any meaningful changes with respect to in my problem. So either I am not turning them correctly, or they are not the right knobs for my problem. Trying to fix my own ignorance here. (should I move this off the bugs list, since maybe it's not a bug?) The settings have been unspecified in the recovery file, it's been specified in the recovery file, and I have tried the following in the recovery file: (~two weeks and it died) keepalives_idle=0 keepalives_interval=0 keepalives_count=0 (~two weeks and it dies) keepalives_idle=30 keepalives_interval=30 keepalives_count=30 (this didn't work either, don't recall how long this lasted, maybe a month) keepalives_idle=2100 keepalives_interval=0 keepalives_count=0 Background is basically this: trying to do streaming replication over a WAN, probably ship about 5GB of changes per day, hardware on both ends can easily keep up with that. Running over a shared metro line and have about 3-5MBytes per second depending on the time of day that I can count on. I have wal_keep segments at 250 (I don't care about the disk overhead for this, since I wanted to not have to use wal archiving). The link is being severed more often than usually lately while some network changes are being made so while I would expect that improve in the future this isn't exactly the most reliable connection. so getting whatever as right as I can is of value to me. Typically I see the streaming replication break down for good completely a few hours after something that causes a interruption in networking. Nagios notifications lag some but not hours and has to go through a few people before I find out about it. When checking the nagios pages on their logs I don't see pages about the distance between the master and the standby getting bigger during this time, and then once I see the first unexpected EOF then the distance between the master and standby gets further and further until it gets fixed or we have to re-sync the whole base over. Again I can't seem to duplicate this problem on demand with virtual machines, I startup a master and standby, setup streaming rep, kickoff a multi hour or day pg bench run and start messing with networking. Every time I try and duplicate this synthetically the standby picks right back where it left off and catches back up. I am at a loss so I do appreciate everyone's help. Thanks in advance -Mark > > Regards, > > -- > Fujii Masao > NIPPON TELEGRAPH AND TELEPHONE CORPORATION > NTT Open Source Software Center