Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZNQ3q-0004Nx-1n for pgsql-admin@arkaria.postgresql.org; Thu, 06 Aug 2015 18:38:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZNQ3o-0000Az-Pa for pgsql-admin@arkaria.postgresql.org; Thu, 06 Aug 2015 18:38:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZNQ3n-00007s-2J for pgsql-admin@postgresql.org; Thu, 06 Aug 2015 18:38:36 +0000 Received: from nm7-vm3.bullet.mail.gq1.yahoo.com ([98.136.218.210]) by magus.postgresql.org with esmtps (TLS1.0:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZNQ3h-00059A-2G for pgsql-admin@postgresql.org; Thu, 06 Aug 2015 18:38:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s2048; t=1438886302; bh=nJU8L/H4RfkjM4ouU2a7juZ/7ZXdtjW3tqMeKWAXCHk=; h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:From:Subject; b=VeOXlt3BYZUd6qjPJWkcJBTbIGMDRzLHqI87hqhDIFBeOfQjIRQ59EddJSz0kD8W9h/nUztYGWSGhpcPoCscyBzXtDLSN/OXAOWcQk/1BK3RV2mfVcTXIKcAjYphz2tT/feRGn3rqWrhm/OOhJGmjln2HPtef+apQ4apO8RpHp+1pYbxauZ7qLx+D/cfEbDB0UyiNXiAht2YtTn9TPqSuYjbA+lucQP97xwSQkJY6ZRgeQU/9NXblXXSwUIim9hO/PpDw88u/nBtamV4hdPSkWkxVRtUrSzyY32tA7mhq7NRVsMOnnkOFn5i+UXTRfRKmX4IVsLQepSR3GQa025uEQ== Received: from [98.137.12.62] by nm7.bullet.mail.gq1.yahoo.com with NNFMP; 06 Aug 2015 18:38:22 -0000 Received: from [98.137.12.199] by tm7.bullet.mail.gq1.yahoo.com with NNFMP; 06 Aug 2015 18:38:22 -0000 Received: from [127.0.0.1] by omp1007.mail.gq1.yahoo.com with NNFMP; 06 Aug 2015 18:38:22 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 855044.73063.bm@omp1007.mail.gq1.yahoo.com X-YMail-OSG: bp8w2JEVM1lZ4RKJysE4Z1jjSfr8c1QwFV6v30Eq1INqZDlxyoEsuZ6nt6mqjJH N1UVKSAVaIPxVrG_D93jeLmKXv_KSSN328wnJFJC2xK1Yu_OsmoZCo9iDFGgQTfT8nhNGpfMthV0 uex4GZ9rGnlkNP5fJvh4hFh_jGbZwvG2s5MA1RW9_TKWLY5CM6uFuMI9gx9bvrhhIGhH_nL9sTNx Mt6hr3Hs6djr7Z.V_d3TME7yCzHjvFUZeMPh9MR6RidUVZq6R6I6Pdlht8pOtU313Ltfh7Y6hQBF CH6X0_wbHjL0Oa2y5uTrVWE_DuErB01oGwZWAYTwq8lQax4L4zf3hrYGCNUKhUNp4dZTYjY2YaNU z7aosmvnz71v9x8SDOB9qsU16fLkk0VCmrJ0wGXGlUoq18wGXghxJWPU0D5qggMyGqQd5B85Zkdd nV4_fDHvaBP7lPQOuOHesfpyoNFyh1u2HTxK8dZTjObGlEvZx2GfP1IQdFpC8inpoBkJEg8Y- Received: by 216.39.60.208; Thu, 06 Aug 2015 18:38:22 +0000 Date: Thu, 6 Aug 2015 18:38:22 +0000 (UTC) From: Kevin Grittner Reply-To: Kevin Grittner To: John Scalia Cc: "pgsql-admin@postgresql.org" Message-ID: <279719692.175841.1438886302084.JavaMail.yahoo@mail.yahoo.com> In-Reply-To: References: Subject: Re: pg_basebackup problem... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Length: 2310 X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org John Scalia wrote: > The problem I've been trying to solve is this: The old procedure > took the tarball pg_basebackup generated, expanded it, then > rsync'd it into the data directory after they removed everything > in that directory including recursively removing the contents of > pg_xlog. Hence, without including the -X f flag, there wouldn't > be any WAL files available for initializing the DB. They old > operation folks caused this problem, and now they want me to fix > it, ie., get a database started from one of these backups where > no WAL segments are present. I keep telling them this is > impossible, but they're arguing it's been done here before and > worked. I've been pointing out the impossibility and stating that > there had to be some WAL files remaining in the pg_xlog directory > for the restore to succeed. The only way to get the base backup started without the WAL records that were generated during the backup is with pg_resetxlog, and that provides no guarantees that there is no corruption. See: http://www.postgresql.org/docs/current/static/app-pgresetxlog.html ... which says, in part: | pg_resetxlog clears the write-ahead log (WAL) and optionally | resets some other control information stored in the pg_control | file. This function is sometimes needed if these files have | become corrupted. It should be used only as a last resort, when | the server will not start due to such corruption. | | After running this command, it should be possible to start the | server, but bear in mind that the database might contain | inconsistent data due to partially-committed transactions. You | should immediately dump your data, run initdb, and reload. After | reload, check for inconsistencies and repair as needed. Absence of WAL files in pg_xlog, or copies made while changes were being logged to them (rather than taken from a stopped cluster or through archiving, streaming replication, or pg_basebackup options) is a form of database corruption. There are many ways to get the WAL records; for example maybe they previously restored before they were removed from the primary system and they had the recovery.conf file configured to retrieve them from there. -- Kevin Grittner EDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin