Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 60C2B1337BDD for ; Thu, 27 Jan 2011 10:17:36 -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 02960-04 for ; Thu, 27 Jan 2011 14:17:28 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp.peak6.com (smtp.peak6.com [38.98.137.6]) by mail.postgresql.org (Postfix) with ESMTP id 9F3FB1337B9D for ; Thu, 27 Jan 2011 10:17:24 -0400 (AST) X-AuditID: 0a64cb1e-b7c55ae000000bfb-5b-4d417e73dad4 Message-ID: <4D417E73.7040901@peak6.com> Date: Thu, 27 Jan 2011 08:17:23 -0600 From: Shaun Thomas Reply-To: sthomas@peak6.com Organization: Peak6 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.7) Gecko/20100720 Lightning/1.0b2 Thunderbird/3.1.1 MIME-Version: 1.0 To: Waldomiro CC: "pgsql-performance@postgresql.org" Subject: Re: Why I lost the last pg_xlog file? References: <4D416099.8060107@shx.com.br> In-Reply-To: <4D416099.8060107@shx.com.br> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed content-transfer-encoding: 7bit X-Brightmail-Tracker: AAAAAQAAAZE= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201101/261 X-Sequence-Number: 42048 On 01/27/2011 06:10 AM, Waldomiro wrote: > 3) I check the pg_xlog, there was created 6 logs, but in the archive > there was only 5. xlogs are only "archived" when they'd normally be deleted. If you have really high data turnover or very frequent checkpoints, that effectively happens constantly. I'm not sure where the cutoff is, but there's a certain amount of "reserve" xlog space based on your checkpoint_segments setting. It is an archive, after all. pg_start_backup/pg_stop_backup ensure your backup is consistent, nothing else. Depending on your archives to capture everything isn't going to work. If you really want everything, you can either copy the xlogs manually (not safe) or initiate another backup. You can kinda fudge it doing this: 1. Call pg_current_xlog_location to get the current xlog. 2. Call pg_switch_xlog to force a new xlog. 3. Copy the file from step 1 and anything older than it to your archive/slave. Doing this *may* confuse the built-in archive system if your archive_command is too strict. 4. Profit. -- Shaun Thomas OptionsHouse | 141 W. Jackson Blvd. | Suite 800 | Chicago IL, 60604 312-676-8870 sthomas@peak6.com ______________________________________________ See http://www.peak6.com/email_disclaimer.php for terms and conditions related to this email