Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YOAkw-0004Au-DJ for pgsql-admin@arkaria.postgresql.org; Wed, 18 Feb 2015 19:57:58 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YOAkv-0003uC-B6 for pgsql-admin@arkaria.postgresql.org; Wed, 18 Feb 2015 19:57:57 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YOAkt-0003u5-Qs for pgsql-admin@postgresql.org; Wed, 18 Feb 2015 19:57:56 +0000 Received: from [2001:558:fe21:29:250:56ff:feaf:60fe] (helo=resqmta-ch2-10v.sys.comcast.net) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YOAkq-0000Cn-Bm for pgsql-admin@postgresql.org; Wed, 18 Feb 2015 19:57:54 +0000 Received: from resomta-ch2-16v.sys.comcast.net ([69.252.207.112]) by resqmta-ch2-10v.sys.comcast.net with comcast id tvxE1p0042S2Q5R01vxpsi; Wed, 18 Feb 2015 19:57:49 +0000 Received: from jerry.enova.com ([12.30.159.20]) by resomta-ch2-16v.sys.comcast.net with comcast id tvxd1p0080ShjPw01vxfyC; Wed, 18 Feb 2015 19:57:47 +0000 Received: by jerry.enova.com (Postfix, from userid 1001) id 1203B7401ED; Wed, 18 Feb 2015 13:57:37 -0600 (CST) From: Jerry Sievers To: girish R G peetle Cc: Kevin Grittner , pgsql-admin Subject: Re: PostgreSQL File System Based Backup Restartability References: <2057820533.544572.1424273370550.JavaMail.yahoo@mail.yahoo.com> Date: Wed, 18 Feb 2015 13:57:36 -0600 In-Reply-To: (girish R. G. peetle's message of "Thu, 19 Feb 2015 00:08:31 +0530") Message-ID: <86d257vvpr.fsf@jerry.enova.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1424289469; bh=e/z3EE/ml1V6yJzenAMW7hHF3Y8PzPRNFXiKUEkz8bo=; h=Received:Received:Received:From:To:Subject:Date:Message-ID: MIME-Version:Content-Type; b=paDs4KR0pH4OqRcKDkZrNwCrLSyP836dMDUNSFYla24jWcc6IEDNOBD9nRYmCuAl5 wksHTgQwUuweL9shJfhRByUP21cIAnWu7PzL27QirVAKXEmR3C5dqlwbl+Y1kht5v4 1lB3L/HKkNHqutxqKHrrYDZYFtxsGQ2kmFTT37GMrSL9H14XuoiiyRS0b5Kz+9ljED 4Wpw5kHzq9SDOw4CubriP8jCMbCYQpGLm5sg3Y+VthaDitEJC90LwhybVybEhUN5AD lTtORJI5XReGZh0VowqrLNo+KGrF/5Zt+Wi2g6dWiToVz0+Ptlvm6Gcsh16boq3lkP aZdkggY8Aa5sg== X-Host-Lookup-Failed: Reverse DNS lookup failed for 2001:558:fe21:29:250:56ff:feaf:60fe (failed) X-Pg-Spam-Score: 0.0 (/) 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 girish R G peetle writes: > Thanks a lot Kevin for the detailed explanation. > In response to your concerns > > 1) I am using the original list, won't create a new list. So we are fine as per your explanation. > > 2) I have a question about partially copied file. What if a file that got partially copied disappears (say it belonged to a table n table was dropped ) when I resume > backup. Should I mark this partially copied file invalid in backup media ? And continue with the next entry in the list ? Stop complicating all of this. Don't rescan the origin server. Just restart copying your files with the one that was incomplete when the failure occurred and then proceed through the list till you reach the end. WAL replay will account for whatever changes took place on the origin since pg_start_backup() was run. This assumes that any files completely copied are not themselves corrupt for some reason. If your copy process is untrustworth in that regard then all of this is pointless anyway. I'd be a lot more comfortable using rsync rather than a home-grown solution or other archiver not commonly used for this porpose. HTH. > Girish > > On Feb 18, 2015 9:00 PM, "Kevin Grittner" wrote: > > girish R G peetle wrote: > > > "Be careful that when you resume after such an interruption you > > do not skip any files and that you complete or re-copy any files > > that were partially copied before the problems." > > > > Here you mean, we should not skip any files that was already > > backed up before interruption ? > > I will have to backup entire content under DATA directory again ? > > No. > > Think of it this way: for every file that existed both when > pg_start_backup() and pg_stop_backup() were run, every OS-level > page must represent the state of that page at some point between > when those functions were run.  *Which* point in time each page > represents is not important, and it is not expected that all files > (or all pages within a file) represent the same point in time.  WAL > replay is guaranteed to fix up all pages modified between those > function executions.  The backup_label file specifies which WAL > records are needed to do that. > > There were two concerns I had with what you described. > > (1)  That when you resume with the 20th file, that is not an > ordinal position in a new list which might have fewer files ahead > of the 20th position, resulting in skipping some files.  If you're > continuing to use the original list, using the position in that > list is fine. > > (2)  That if the error occurred part-way through reading a file, > leaving a portion uncopied, that the missing portion be copied. > (Of course re-copying the whole file works, too; but you could > safely resume just past the last page successfully copied before > the network problems.) > > -- > Kevin Grittner > EDB: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > -- Jerry Sievers Postgres DBA/Development Consulting e: postgres.consulting@comcast.net p: 312.241.7800 -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin