Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cVgYI-0002kJ-1n for pgsql-performance@arkaria.postgresql.org; Mon, 23 Jan 2017 15:29:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cVgYH-00059i-16 for pgsql-performance@arkaria.postgresql.org; Mon, 23 Jan 2017 15:29:01 +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_2) (envelope-from ) id 1cVgYF-00056Q-FX for pgsql-performance@postgresql.org; Mon, 23 Jan 2017 15:28:59 +0000 Received: from mail-sn1nam01on0087.outbound.protection.outlook.com ([104.47.32.87] helo=NAM01-SN1-obe.outbound.protection.outlook.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cVgYA-000219-Pa for pgsql-performance@postgresql.org; Mon, 23 Jan 2017 15:28:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=BlueTreble.onmicrosoft.com; s=selector1-bluetreble-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=q2z7TAASjfAfsEAniszenmSFfbJ071iq4JrhcjGE+vI=; b=KR3Fm8oUMt9tsDqbM7cbyRoEk8eCTiVMFZadP6v2o9UwnRt0UaGqCERLln3OwtIEJzgR2MXwZ646fsImGDDaHxivVYrQ0AJ3l9az6TVZTg7S3EXNJ+QHEpDXVA6T1J5EA4ST8QmP5Kx7/kri34O3a7zXBPoFRsGjsl3mqtKYdxU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jim.Nasby@bluetreble.com; Received: from decina.attlocal.net (2602:306:ce8b:3460:fc78:abce:71e8:6436) by BN6PR11MB1636.namprd11.prod.outlook.com (10.172.24.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Mon, 23 Jan 2017 15:28:47 +0000 Subject: Re: Backup taking long time !!! To: Stephen Frost , julyanto SUTANDANG References: <0fb0c8c3f69340a3a7d70b1c39fa2b2c@cyient.com> <20170122145511.GD18360@tamriel.snowman.net> <20170122163748.GG18360@tamriel.snowman.net> <20170122173245.GH18360@tamriel.snowman.net> CC: Dinesh Chandra 12108 , "pgsql-performance@postgresql.org" From: Jim Nasby Message-ID: Date: Mon, 23 Jan 2017 09:28:34 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <20170122173245.GH18360@tamriel.snowman.net> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [2602:306:ce8b:3460:fc78:abce:71e8:6436] X-ClientProxiedBy: BY1PR20CA0027.namprd20.prod.outlook.com (10.162.140.37) To BN6PR11MB1636.namprd11.prod.outlook.com (10.172.24.9) X-MS-Office365-Filtering-Correlation-Id: e6ea10e0-a0e9-4500-6cad-08d443a4887c X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BN6PR11MB1636; X-Microsoft-Exchange-Diagnostics: 1;BN6PR11MB1636;3:rSp9TLFwQDOt0hkhVc5qq977SY+jk2OODYE4N7IOAOGfjdtV0p1xKcEDqLK8MoNgiCZ2MzmM+Vgj95IGZPSbUy7P57sDpCF7do6s0o6lpdSxQMb773XWh8UJ0xFCx0VprB+Ojokxq6Oubo+1rPcprNTVc3s6rZf8LXXpm8jwZvqpXrhSBhW1oL6tqHbZvWwZ2QeiBitJTGgjVOYEJGYIrTWO5hpJO2UaD+pS5+vaeELMBPsiOd4No0d5k0pk367Z1OpuGsrO8QEKacUM64xXbw==;25:Hv5s43bIr30rv6GU0HKQGPC4jpcKUwcZY80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HC5Nncun0Uj8SiCKGb+tBV+nPk3yv/xba5aOQ317IKqiTrB6owWKupcpMqZJJkaZqQx3GKKuY0S4fRTqVVy59605PY5mEgE/mwO5FmbCaZAfMxnuXMijOET4VvGQXPxelFNYEdPJRygQb5WLO56xckwbVtMnT77FsmA2cdwZDExH22icpo9VB+7Dfnz+uagB68Q2HIlmlkNC162AubtoJneIOaYsshGrFYQSQvf2VWhOcasdyt7ZWrpX4apor2d83X8Fw9PM4nzGrr4Ug4fxE0zseC5amm6gcryoJHVBjLyIIojvZK+jgrKdlnXZrcYZZfD22QLfAnmAmx X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123560025)(20161123562025)(20161123555025)(20161123564025)(2016111802025)(6072148)(6043046);SRVR:BN6PR11MB1636;BCL:0;PCL:0;RULEID:;SRVR:BN6PR11MB1636; X-Forefront-PRVS: 0196A226D1 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(7916002)(39410400002)(39830400002)(39450400003)(199003)(24454002)(189002)(377454003)(53936002)(92566002)(54356999)(64126003)(36756003)(86362001)(2950100002)(2906002)(50986999)(6666003)(4001350100001)(97736004)(5001770100001)(189998001)(33646002)(31696002)(50466002)(6116002)(4326007)(93886004)(23746002)(230700001)(76176999)(16601075003)(53416004)(42186005)(65826007)(105586002)(106356001)(305945005)(38730400001)(31686004)(7736002)(229853002)(6486002)(6506006)(25786008)(54906002)(65806001)(65956001)(6512007)(6306002)(5660300001)(47776003)(81166006)(81156014)(101416001)(68736007)(223973002)(69596002)(83506001)(8676002)(225543005)(85282002);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR11MB1636;H:decina.attlocal.net;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: bluetreble.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;BN6PR11MB1636;23:DgMlIYYwDh7hLPspWG6u9gaASJVwjdQlN5JeT?= =?Windows-1252?Q?YF0y6Vrk82NKK78YbbxsVKdzftZf/kEHBECMrW3yqVcU8sUZe4E7+0k0?= =?Windows-1252?Q?2SjeW+urcSPaTbi3hDA0/ADETOYi4zBwMCdMX93Clyx6X9nGLZkt42Kh?= =?Windows-1252?Q?D5X9r9r2xTurJXzr488s9XXlVnx3mGMyu0SMWwlDUY2zcPcJwYSPiusP?= =?Windows-1252?Q?JnGDjirSetlH/QZIbiG4qg/cUsqNJZVK0M+c9HvIQTy6B1Umbtaoaq8W?= =?Windows-1252?Q?Xzlg2vBf+P50kpH0VBPeYrsHpxDHhwjCzv9bD84vfI5m6lGSpOF3/aoF?= =?Windows-1252?Q?21haSPqkdMHhKTxkNMyJt3YyhB3I3qM/L4z8Y+H7B/izzDCoFohr2NPY?= =?Windows-1252?Q?H/bJpUEbA8vYoZaeOp2anLNNmOmvP9idu+cEyr8uADyZuWzm4Q316okV?= =?Windows-1252?Q?An2cdUea0wtDHODrOL2TA0cX+sQSt9rylo/iiziuFrdryG9RiJe3cRCd?= =?Windows-1252?Q?uBVY8QiXE6SLuliAUTw0ytrtajz37mJw6cXxOTGjTp6ro/9d4QKwbiF+?= =?Windows-1252?Q?nh4FA1ffW/LjoTk4BJOeryvTokI6LDMdQHuGFoZhJWwlhq0YLCWbJZym?= =?Windows-1252?Q?AFaozRVuEBzgmkjfmsXiqwYule/oUTgmftGP/C1IcBBnlTQ2j3Nor3X4?= =?Windows-1252?Q?/rsjnl6nf83ibjJsYujlNoM5WHiOIqR7nB3sSxCXce85x8JvT2bDo327?= =?Windows-1252?Q?FOsCGy/h2oIyhK6ywKNa66qQFF5BVohFr8F9dybO11npa7Y6niMTrLiy?= =?Windows-1252?Q?zpfvCn5UQ6mGCycfTfbjOftuHXIRVA4bV6gFJqvEvzDp4sSN0IW1SqKy?= =?Windows-1252?Q?i3h+pEIjhDPvtkfOZQo4qWYnAn5ePVAszGHZ+3Jq/O5Vquq5pg732O5o?= =?Windows-1252?Q?37s4xclrb4paF5aiAQX4b7yOjCaBOc12MJTPQ0p/a025Xlc72z97fBWd?= =?Windows-1252?Q?Zt7CcCGDMG7+8qQlB9SXOe5xaKIT6Jd1aO8m/5ksZrlaZ7ix32rCgsPc?= =?Windows-1252?Q?ffmSWapNIt/PmX9Daki7NgLACbN70bEIfGZn5m0XmKEKYoIQL3lUKFr2?= =?Windows-1252?Q?GhFwCDtfncusZ9HeM4xvpsjf1eiLifhojaqv2+HEU1iJ5yTYKJEjFCY6?= =?Windows-1252?Q?Aw0ovzgdL7j94cYuqweqG8l9LirUPJI7rqjbvlkfAqPcnLBufwlNpeAu?= =?Windows-1252?Q?72v/D0mXHvnbgzM+1QFJn8AKujyEf3sl5UEjKjYo5c1lYrTRtaEplOE1?= =?Windows-1252?Q?kMMi4MEy7WGURRYNYbdT1w1A0c8k7e5VJwRhS03EbIrG9pp2aeH0lcfj?= =?Windows-1252?Q?U0xmQUFkmngMe+1ZPCoOL4NTrIau7kq1CXYS/JcswCVkRDWiSXNyiRjr?= =?Windows-1252?Q?sAHfVwwo5MjHJCbJxhzB3pA8KtsauTfqbP8Eb8LAnAOvYlBnOpwIqqjI?= =?Windows-1252?Q?yj6KqxcE0x8mckASOiRCJiikJpVAiPEh6GkwqiYQxGNXKy6U4+jiaEpl?= =?Windows-1252?Q?mC9lZBfFC0dY8tK6w/pw9GUyq1RNZHGwzRTJzDBf/urNQ6t770UhI4Wk?= =?Windows-1252?Q?QamrMvE4Q4KTxChgkJCDwJYGF5h3X2R+9Acqpq0xx1W?= X-Microsoft-Exchange-Diagnostics: 1;BN6PR11MB1636;6:Tvbnos3/prxX5N8LI23PKHnZZW3ejBCFFy6pS64x5hvSB1PGpzn1lW6nU+WxBcuQvgP9IsMHcy1y75882/XSjlQ51CAtDOUYeRWRatr4FJ3vGLfYjLusDFP9juEsW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sCe9Bi/7d1pudZ9gqKxwU9PsfJnPrl68N8Vvht29SrHO5PhCQySv0vg== X-OriginatorOrg: bluetreble.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2017 15:28:47.8019 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1636 X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On 1/22/17 11:32 AM, Stephen Frost wrote: > The 1-second window concern is regarding the validity of a subsequent > incremental backup. BTW, there's a simpler scenario here: Postgres touches file. rsync notices file has different timestamp, starts copying. Postgres touches file again. If those 3 steps happen in the same second, you now have an invalid backup. There's probably other scenarios as well. In short, if you're using rsync, it's *critical* that you give it the --checksum option, which tells rsync to ignore file size and timestamp. >>>> my latter explanation is: use pg_basebackup, it will do it automatically >>>> for you. >>> Yes, if you are unsure about how to perform a safe backup properly, >>> using pg_basebackup or one of the existing backup tools is, by far, the >>> best approach. Attempting to roll your own backup system based on rsync >>> is not something I am comfortable recommending any more because it is >>> *not* simple to do correctly. >> OK, that is fine, and actually we are using that. > You must be sure to use one of the methods with pg_basebackup that keeps > all of the WAL created during the full backup. That would be one of: > pg_basebackup -x, pg_basebackup -X stream, or pg_basebackup + > pg_receivexlog. > >> the reason why i explain about start_backup and stop_backup is to give a >> gradual understand, and hoping that people will get the mechanism in the >> back understandable. > I'm more than happy to have people explaining about > pg_start/stop_backup, but I do have an issue when the explanation is > incorrect and could cause a user to use a backup method which will > result in an invalid backup. The other *critical* thing with PITR backups: you must test EVERY backup that you take. No test == no backup. There's far, far too many things that can go wrong, especially if you're rolling your own tool. The complexities around PITR are why I always recommend also using pg_dump on a periodic (usually weekly) basis as part of your full DR strategy. You'll probably never use the pg_dump backups, but (in most cases) they're a really cheap insurance policy. -- Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX Experts in Analytics, Data Architecture and PostgreSQL Data in Trouble? Get it in Treble! http://BlueTreble.com 855-TREBLE2 (855-873-2532) -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance