Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c6IOF-00012g-6q for pgsql-admin@arkaria.postgresql.org; Mon, 14 Nov 2016 14:37:43 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c6IOE-0001pN-06 for pgsql-admin@arkaria.postgresql.org; Mon, 14 Nov 2016 14:37:42 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c6HFE-0001f3-3W for pgsql-admin@postgresql.org; Mon, 14 Nov 2016 13:24:20 +0000 Received: from mail-pg0-x236.google.com ([2607:f8b0:400e:c05::236]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1c6HFB-0008S7-7o for pgsql-admin@postgresql.org; Mon, 14 Nov 2016 13:24:18 +0000 Received: by mail-pg0-x236.google.com with SMTP id p66so54296015pga.2 for ; Mon, 14 Nov 2016 05:24:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=Yn6GwcQKhx9z81I0V+nvVoDhoJZPNgeXDUAZgdZN1aM=; b=Jb4mPYqxWa/DnvyTcAx9gJsx3qw2MgdIUOg22KW+desvfj+CVoRxFrsMJu2htiNH+N a0YiE71dwEK3AgidrJPM4EhEAflcFLNBZgXQnlMfYefzO4ae4sW54wBsrWo856eDozgc Kz07IjsrN+beQVfeKjmkqHUbfAbkJeG3jLJq6/rHchO809uhOkH6WnGBhJ0ZqZnZkETE YWaxau+eUoqrqZ2ebq+5IKLWSYVVfMaLrlUpTfhc+Mt3RYovNFnEdBb6GGLfO5Xb93y8 yI7yH4OGtri2KnuegBh2iZyw3U58F7UGgfFeDFTMUN/iCy4RK1TV9keQtVAPZQp6zFvr 1QEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=Yn6GwcQKhx9z81I0V+nvVoDhoJZPNgeXDUAZgdZN1aM=; b=cjB+ITd962ov7Gcg8zIpAxPoQsPkNW/3Gsx3OH5KjwK8i4cXJl+Mcbpcza8Bl9OQUx 2q1lfpEaeQiAzy4VpvjsP0hbwjrGr0cxbxjIAKMNthpnQbWrDqRaI5fJ7NSoLADEILUK 9bwZ1b9HsRILyTSIb7EuF6Um6oLljiH6XN9w9QmeGRccc/odcb2XFsOdD/U02M9r/NaL QocSJzeLEI9bSDbXkBEyfoe+L9RyVNr6/G9KqBB3PFLMvj9uEvg/LCFvI9FSAeb39QBZ Qx01TZe3Tz5wBz1jPZUaV+hI8ZhQP3UWZwZnZd/Ok3bYTfzUdayIa52lZ4Aph8cD4r6q ZhiA== X-Gm-Message-State: ABUngveM2gmIAqz9J1hE9+P3VMNj2mkf6uFPB3MkSXH7NxLDbkaM1kqAvw0r8klLq6L+0JW3Z/YlL5FMCfs8O5ZtJKMjxmVHqFbA0R6t4i3BH0qVXSgKDr95kgMfT0ZjRg/9chQYLCYklJKVAu/fd6g3O6WpetWUmKRZ3U11C3xJwY/P8FelkhmuS8tJPLO08Quum7DO X-Received: by 10.99.0.194 with SMTP id 185mr37494002pga.111.1479129855760; Mon, 14 Nov 2016 05:24:15 -0800 (PST) Received: from osaka.octopusnet (p12022-ipngn4701marunouchi.tokyo.ocn.ne.jp. [153.160.123.22]) by smtp.gmail.com with ESMTPSA id z62sm11883806pfz.19.2016.11.14.05.24.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Nov 2016 05:24:15 -0800 (PST) Subject: Re: WAL restoration is not happening completely To: rajan , pgsql-admin@postgresql.org References: <1479116970057-5930204.post@n3.nabble.com> From: Ian Barwick Message-ID: <6c88ca7e-3ebc-993d-3f9d-7309a077ccc8@2ndquadrant.com> Date: Mon, 14 Nov 2016 22:24:12 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1479116970057-5930204.post@n3.nabble.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) 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 Hi On 11/14/2016 06:49 PM, rajan wrote: > Hi, > > In postgresql.conf file we have set the following configuration, > wal_level=hot_standby > archive_mode=on > archive_command='test ! -f /archives/%f && cp %p /archives/%f' > max_wal_senders=1 > wal_keep_segments=128 > > and took a base backup using the command, pg_basebackup --xlog --format=t -D > /backups/`date +%Y%m%d` > > This base backup and WAL files from the '/archives' dir are moved to another > machine in which the base.rar is extracted into $PGDATA folder and WAL > files(9 files) are copied to '/archives' folder. > > recovery.conf is created under the $PGDATA folder with the command > "restore_command = 'cp /archives/%f %p'" and then the postgres db service is > started. > > *The restored database has changes which were done today and missing data > from changes did a couple of days before.* Are you absolutely sure about this? All changes present in the archived WAL *will* be replayed sequentially; it's not possible that an arbitrary subset of changes will be left out. Which PostgreSQL version are you using, and what are the exact contents of the recovery.conf file? For working with backups and WAL archiving I suggest you take a look at "Barman" ( http://www.pgbarman.org/ ). Regards Ian Barwick -- Ian Barwick http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin