Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eAk0c-0000PO-Rv for pgsql-admin@arkaria.postgresql.org; Fri, 03 Nov 2017 22:00:15 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eAk0c-0001TP-EM for pgsql-admin@arkaria.postgresql.org; Fri, 03 Nov 2017 22:00:14 +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 1eAk0b-0001Ri-9r for pgsql-admin@postgresql.org; Fri, 03 Nov 2017 22:00:13 +0000 Received: from cat-porwal-prod-mail1.catalyst.net.nz ([202.78.240.226]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eAk0X-0007m1-38 for pgsql-admin@postgresql.org; Fri, 03 Nov 2017 22:00:12 +0000 Received: from localhost (localhost [127.0.0.1]) by cat-porwal-prod-mail1.catalyst.net.nz (Postfix) with ESMTP id CAE4E80FE2; Sat, 4 Nov 2017 11:00:04 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at cat-porwal-prod-mail1.servers.catalyst.net.nz Received: from cat-porwal-prod-mail1.catalyst.net.nz ([127.0.0.1]) by localhost (cat-porwal-prod-mail1.servers.catalyst.net.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yVFZJ2X3Oyxv; Sat, 4 Nov 2017 11:00:03 +1300 (NZDT) Received: from [IPv6:2406:e001:c91:1:29cb:1d44:e19f:a80f] (unknown [IPv6:2406:e001:c91:1:29cb:1d44:e19f:a80f]) (Authenticated sender: mark.kirkwood@catalyst.net.nz) by cat-porwal-prod-mail1.catalyst.net.nz (Postfix) with ESMTPSA id 9B86680FDA; Sat, 4 Nov 2017 11:00:03 +1300 (NZDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catalyst.net.nz; s=catalyst; t=1509746403; bh=BuS0DiZDSWCuggNoDvVm6nVRJmxNXBroxm3Oj1Ai9d8=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=bMrdQOYf7IH/H3uhn3uxQLFg/XWfeRMuLQnwWWKwRSSYrv5iycepi6Tb1VkrkwM5n sYJtvGWr4L0j8pusQctA9torqz81n8jT3hWuT3O1uzYNuaBQHDbVM/GFBQmCdz7O8J xzsjZLlwmVV4i1rowAUd3VTdr7A0KKMaTKTBV25A= Subject: Re: Bad recovery: no pg_xlog/RECOVERYXLOG To: Stephen Frost Cc: pgsql-admin@postgresql.org References: <1070071508952614@web46j.yandex.ru> <20171030154706.GE4628@tamriel.snowman.net> <7966ee9e-2241-eced-4639-e32c157b915a@catalyst.net.nz> <20171031114756.GP4628@tamriel.snowman.net> <2e3453d3-da6f-88af-05ec-7530e7f60547@catalyst.net.nz> <20171101122847.GS4628@tamriel.snowman.net> <4efa2769-78c4-7bf0-5c33-0cf2d942ce74@catalyst.net.nz> <20171101221807.GW4628@tamriel.snowman.net> <94a943ac-8b63-5cfc-9d48-22b7193b9766@catalyst.net.nz> <20171102111141.GZ4628@tamriel.snowman.net> From: Mark Kirkwood Message-ID: <45c0bedc-9ce8-b99b-80df-94a1180fbc88@catalyst.net.nz> Date: Sat, 4 Nov 2017 11:00:03 +1300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171102111141.GZ4628@tamriel.snowman.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US 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 Stephen, On 03/11/17 00:11, Stephen Frost wrote: > > Sure, that'll work much of the time, but that's about like saying that > PG could run without fsync being enabled much of the time and everything > will be ok. Both are accurate, but hopefully you'll agree that PG > really should always be run with fsync enabled. It is completely different - this is a 'straw man' argument, and justs serves to confuse this discussion. > >> Also, if what you are suggesting were actually the case, almost >> everyone's streaming replication (and/or log shipping) would be >> broken all the time. > No, again, this isn't an argument about if it'll work most of the time > or not, it's about if it's correct. PG without fsync will work most of > the time too, but that doesn't mean it's actually correct. No, it is pointing out that if your argument were correct, then there should be the above side effects - there are not, which is significant. The crux of your argument seems to be concerning the synchronization between pg_basbackup finishing and being sure you have the required archive logs. Now just so we are all clear, when pg_basebackup ends it essentially calls do_pg_stop_backup (from xlog.c) which ensures that all required WAL files are archived, or to be precise here makes sure archive_command has been run successfully for each required WAL file. Your entire argument seems about whether said WAL is fsync'ed to disk, and how this is impossible to ensure in a shell script. Actually it is possible quite simply: e.g suppose you archive command is: rsync ... targetserver:/disk There are several ways to get that to sync: rsync .. targetserver:/disk && ssh target server sync Alternatively amend  vm.dirty_bytes on targetserver to be < 16M, or mount the /disk with sync option! So it is clearly *possible*. However, I think you are obsessing over the minutiae of fsync to single server/disk when there are much more important (read likely to happen) problems to consider. For me, the critical consideration is, not 'are the WAL files there *right now*'..but 'will they be there tomorrow when I need them for a restore'? Next is 'will they be the same/undamaged when I read them tomorrow'? This is why I'm *not* obsessing about fsyncing...make where you store these WAL files *reliable*...either via proxying/ip splitting so you send stuff to more that one server (if we are still thinking server + disk = backup solution). Alternatively use a distributed object store (Swift, S3 etc) that handle that for you, and in addition they checksum and heal any individual node data corruption for you as well. >> With respect to 'If I would like to develop etc etc..' - err, all I >> was doing in this thread was helping the original poster make his >> stuff a bit better - I'll continue to do that. > Ignoring the basic requirements which I outlined isn't helping him get > to a reliable backup system. Actually I was helping him get a *reliable* backup system, I think you misunderstood how swift changes the picture compared to a single server/single disk design. regards Mark -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin