Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fdwo3-0003H0-6u for pgsql-general@arkaria.postgresql.org; Fri, 13 Jul 2018 12:04:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fdwo1-0000ZO-7J for pgsql-general@arkaria.postgresql.org; Fri, 13 Jul 2018 12:04:13 +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.89) (envelope-from ) id 1fdwo0-0000ZH-SZ for pgsql-general@lists.postgresql.org; Fri, 13 Jul 2018 12:04:13 +0000 Received: from mail.i-mark.de ([188.138.104.222]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fdwnx-0006Lj-Hp for pgsql-general@lists.postgresql.org; Fri, 13 Jul 2018 12:04:11 +0000 Received: from [192.168.178.20] (unknown [185.38.49.16]) by mail.i-mark.de (Postfix) with ESMTPSA id 8B07D1580104 for ; Fri, 13 Jul 2018 14:04:02 +0200 (CEST) Authentication-Results: loft7616.startdedicated.de; spf=pass (sender IP is 185.38.49.16) smtp.mailfrom=andreas@a-kretschmer.de smtp.helo=[192.168.178.20] Received-SPF: pass (loft7616.startdedicated.de: connection is authenticated) Subject: Re: Database Refresh confusion To: pgsql-general@lists.postgresql.org References: <142590143.3855746.1531480255648.ref@mail.yahoo.com> <142590143.3855746.1531480255648@mail.yahoo.com> From: Andreas Kretschmer Message-ID: Date: Fri, 13 Jul 2018 14:04:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <142590143.3855746.1531480255648@mail.yahoo.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Am 13.07.2018 um 13:10 schrieb Rijo Roy: > Hello Experts, > > Today, my colleague asked me if there was any way to check the > progress of recovery (backup-recovery) in Postgresql. I told him to > check the postgresql logs and look out for keywords such as recovery. > He was refreshing the database by restoring a database backup but the > method he tried surprised me. > The below commands were used: > pg_basebackup -h remoteservername -p Port number -D /path -X s -c fast > -n -P -v > And he just started the postgresql cluster using pg_ctl > > I told him that he missed creating a recovery.conf with a recovery > command, that's not necessary, without recovery.conf postgres will start as a normal server. > but he told me that he always does this way.  I told him that the > process is wrong and this will do a crash recovery and there are high > chances of data corruption. No, this way is safe > He replied saying he never faced an issue following his process of > doing it without recovery.conf > > 2 questions: > 1. Is this a good practice for refreshing data into a new server. > 2. Is there any other mechanism to track the restoration process other > than to check the postgresql logs. pg_basebackup has a progress-feature, -P, see you command above > > The postgresql version used in 10.0 on a Linux 6.9 the latest version is 10.4 and contains a lot of bugfixes, consider a update soon. Regards, Andreas -- 2ndQuadrant - The PostgreSQL Support Company. www.2ndQuadrant.com