Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c9dvE-0005Xd-1b for pgsql-docs@arkaria.postgresql.org; Wed, 23 Nov 2016 20:13:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c9dvD-0005qS-Fn for pgsql-docs@arkaria.postgresql.org; Wed, 23 Nov 2016 20:13:35 +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 1c9dur-0005S1-0T for pgsql-docs@postgresql.org; Wed, 23 Nov 2016 20:13:13 +0000 Received: from pro-open.de ([87.106.136.39] helo=www.pro-open.de) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c9dun-0006yC-QQ for pgsql-docs@postgresql.org; Wed, 23 Nov 2016 20:13:12 +0000 Received: from [192.168.178.24] (x2f21b1b.dyn.telefonica.de [2.242.27.27]) by www.pro-open.de (Postfix) with ESMTP id 2F15C1045EF3; Wed, 23 Nov 2016 21:13:06 +0100 (CET) Subject: Re: Missing important information in backup.sgml To: Kevin Grittner References: <20161116143651.GC13284@tamriel.snowman.net> <80e18b98-9b72-ddee-2a34-76302e5d8a0b@pro-open.de> Cc: "pgsql-docs@postgresql.org" , Stephen Frost From: "Gunnar \"Nick\" Bluth" Message-ID: Date: Wed, 23 Nov 2016 21:12:56 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="n5I4jc0Wsip05G9K92sBaxWt7XqCtm9m2" X-Pg-Spam-Score: -4.8 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-docs Precedence: bulk Sender: pgsql-docs-owner@postgresql.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --n5I4jc0Wsip05G9K92sBaxWt7XqCtm9m2 Content-Type: multipart/mixed; boundary="R8XQQQTEgat6Iu22rA577XBVlI53VK2N6"; protected-headers="v1" From: "Gunnar \"Nick\" Bluth" To: Kevin Grittner Cc: "pgsql-docs@postgresql.org" , Stephen Frost Message-ID: Subject: Re: [DOCS] Missing important information in backup.sgml References: <20161116143651.GC13284@tamriel.snowman.net> <80e18b98-9b72-ddee-2a34-76302e5d8a0b@pro-open.de> In-Reply-To: --R8XQQQTEgat6Iu22rA577XBVlI53VK2N6 Content-Type: multipart/mixed; boundary="------------1B0EBEBABF379F6E12C0CB47" This is a multi-part message in MIME format. --------------1B0EBEBABF379F6E12C0CB47 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Am 23.11.2016 um 20:21 schrieb Kevin Grittner: > On Wed, Nov 23, 2016 at 12:24 PM, Gunnar "Nick" Bluth > wrote: >=20 >> mentions Stephen's >> remarks on rsync (although to get actual _data loss_, you'd have to ha= ve >> a power outage in the DC caused by your PG server exploding... ;-). >=20 > I have seen power loss between the UPS and a server; including a > tech tripping on the power cord. I have also seen servers abruptly > shut down due to high temperatures in spite of having a UPS. I > have also seen an OS bug lock up a system such that it was > impossible to get a clean shutdown before having to cycle power to > recover. >=20 > No explosion needed. >=20 > If you value the data in your database you should assume that the > OS could go down at any instant without proper shutdown, and that > your storage system(s) could be lost without warning at any time. Kevin, all, I've been in this business for 15 years, and had my share of outages. The worst case being an AC service guy pushing the big red button next to the DC entrance, assuming it was the light switch... It's not like I've not gone through the possible scenarios in my head before writing such a broad statement. Let me explain. Assertions (that I take as givens for anyone valueing his data...): - you have decent HW (BBU controller, HDD cache off, ECC RAM, redundant PSUs, ...) - you have a decent DC (UPS, AC, ...) - you use a single DB server and/or no (synchronous) replication in place= - your archive server is in the same DC (potentially the same machine as the DB server) - (in case of SAN) your storage correctly reports when it has written to disk/BBU cache - your OS (and/or archive_script) does not report RC=3D0 before all data has been _transmitted_ (think MongoDB... ;-) - (for the sake of completeness) fsync=3Don for PG Now, what could happen is a) complete DC power outage b) outage of DB server c) outage of archive server (or the network connection to it) d) outage of storage system e) complete DC outage caused by your DB server vanishing (burning down, exploding, melting, ...), f) a complete _loss_ of the DC (atomar strike, plane crash, ...) In case a), your DB server would have fsync'd all committed transactions =3D> no _data_ loss, but your _archive_ is potentially incomplete. In case b), the same applies, but your archive should be intact. In case c), the archiver would retry until your archiving server comes back online =3D> no _data_ loss, no _archive_ loss. In case d), see a), if you're lucky b) In case e), you'd have lost your DB _and_ your archive may be incomplete.= In case f), your f)....d anyway (oh, the coincidence! ;-). Protecting yourself from case f) will involve a 2nd (3rd, ...) DC (or some cloud thingie) anyway. In my experience, users that do have more than one DC also have a policy in place saying that backups (which archive logs would probably be counted as) have to be placed in a different DC. So, losing actual _data_ is unlikely (at least from the archiving point of view...), but not explicitly fsync'ing the archive _may_ lead to incomplete archives. Which is exactly what I tried to point out by "[...], rendering your archive incomplete in case of a power outage". Am I missing something? P.S.: just to point that out... my patch does _not_ mention exploding servers ;-) Cheers, --=20 Gunnar "Nick" Bluth RHCE/SCLA Mobil +49 172 8853339 Email: gunnar.bluth@pro-open.de _____________________________________________________________ In 1984 mainstream users were choosing VMS over UNIX. Ten years later they are choosing Windows over UNIX. What part of that message aren't you getting? - Tom Payne --------------1B0EBEBABF379F6E12C0CB47 Content-Type: application/pgp-keys; name="0x3289338C.asc" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0x3289338C.asc" -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v2 mQENBFOuo7ABCADU3rFM4gBv4l/Xjfry27pfdYgvWrcR1RA/vLfOgjqivSbMQEHH bTWprJRjB2EbzmTS+faSa/V+mH/jIKBytCc5+hprBd/m5if3/v2PKA7+MHsy1H9T 7FqTKRccNl7RIcKFOaonIbY4qMyH6cFafZOgq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QlmAYAACgkQEBCuazKJM4xN1wf+MPLXrQ10 LBRtYjD16LsvxDyEcSMoWGc26DO/TDsGwme2NVfL0JufExgdpvkk/x4wzBwdkYfF dNKU3CyA+3T4FuKGL7RPrICJa+VdCvwMk8dzLqF0UgdfVHtCnUQoQmNnDD7gODw/ GTIKpWw+iEE2/EANAONXj7EC+VsW895/C5aQEZx++cSonrHFSSIUp1OGJoVlmFnJ MFCTTElmayTcmfOwGHrn97Et5YePMOsyqWZas+URuJveoTdGhDToOIufECGb3WJa J8rFL+ni3NKoiZhZMYVQ+XC8f64Mi5kXlfsylVu6kgCoFqnq7FTpwqOiRml4APeX GBC6uZW6fUGNDQ=3D=3D =3D//tm -----END PGP PUBLIC KEY BLOCK----- --------------1B0EBEBABF379F6E12C0CB47-- --R8XQQQTEgat6Iu22rA577XBVlI53VK2N6-- --n5I4jc0Wsip05G9K92sBaxWt7XqCtm9m2 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJYNfhPAAoJEBAQrmsyiTOM448IALGh+nyXjE0vgNv6cUazAOEv ewZihQtXDbCh04rs5SLxmdDrqIy6LO/0KsnApicH6hoSjbGavZt6NQro6/EUnMS8 jgx6JI+JI9Qd7frJ5/IKT9d5GuUl74awrhy2x4bh5cqAIAxo/lsbHpzgHUo8TmGh CeBk0PTbtFiOFqSqx1/2U2wvAVMZx8FGxN+E1ApwTMr5rmLSwPgpfAH+sEAZNUba YWi1LnMKwQ+oCF44xorHCJKzQ0qgETOWu+OMWAhmS7Syw8OwfhzvaBnVIg7kT+gI Xu/Cawo6Iyn2zIrenoqHG/+NNo8aPZ7S/C5eGInMzUy01LHUyw+fcg3NGaUIurw= =HHaa -----END PGP SIGNATURE----- --n5I4jc0Wsip05G9K92sBaxWt7XqCtm9m2--