Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bme36-0005f5-El for pgsql-bugs@arkaria.postgresql.org; Wed, 21 Sep 2016 09:42:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bme34-00058U-Vz for pgsql-bugs@arkaria.postgresql.org; Wed, 21 Sep 2016 09:42:39 +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 1bme33-00057t-VP for pgsql-bugs@postgresql.org; Wed, 21 Sep 2016 09:42:38 +0000 Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bme30-0006cq-O5 for pgsql-bugs@postgresql.org; Wed, 21 Sep 2016 09:42:37 +0000 Received: by mail-wm0-x22f.google.com with SMTP id l132so257324736wmf.0 for ; Wed, 21 Sep 2016 02:42:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant.it; s=google; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to; bh=y5q8Z0Ei0SPrXmYFSncRWpVwDT7dRHcmj98xIinbTZ0=; b=kGzBuuSBLoaH2ak9ITrPi8r8SltvcWvsyTd/hiaTgJKHQpT7OGZX4xJQhdjm/Lt9Ht jjdNuo1a1yWRme+HS0dczTSn6yjq6y0mMYtXYdg8RZ6MBNagF6WnFXpUjWjAMFW20rGn fd+WT1FFV4NhbpwDvZkXjEQLzoDXyKYnDU58o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=y5q8Z0Ei0SPrXmYFSncRWpVwDT7dRHcmj98xIinbTZ0=; b=YeiCEsxNVXvhRYfRXb/8/0xzjCm+WnUUPZquZwIccm2QPRWRhVWDqpjUA6j4U8lMDE u837bGIeCusovNqDpQL73QMt13zbCsfjaERAH1wmTGLScNrhxa4XsXL0MNDB6v5dc9p5 wxXRbK0ZcfOVsN5l5kNGhwUBsGSakWfrqtorYV3S35qGGVUO1L9uqroYHeAQEvrDZKHR 7kYSf8/ChPsZxFmW5IgoNk+zDcbk7xIglS6/uww/gv+uhx13q/cNduCfrKJ6vdl9fyqw TYFYHW1RwSsza8AEKb4YgK6tX+Oqvydxl1ghSo+dFCaEkwOiLLoh6fSZxdDFjOZT2+Gn SEpg== X-Gm-Message-State: AE9vXwPZsmmbYNvWSaele+I7szJQx2kVyrQLZk1iQt9ixeXFoZAemZQdHP5lU2csIpIEznx1+bfkTRvo3QnL4WNvlpTtEpqCJWsvQL2wSRBrXAzO60e3mgcbJQVQOGOZTJq8VaaaNUZv7uCR7IHF01qnZYYdSWQ9IBFlGjK3d8+9UkOy9LBnlGJiC0xy765C5Ntw3nkgMlGj X-Received: by 10.28.198.65 with SMTP id w62mr2124154wmf.63.1474450953200; Wed, 21 Sep 2016 02:42:33 -0700 (PDT) Received: from titanium.local (net-37-182-231-222.cust.vodafonedsl.it. [37.182.231.222]) by smtp.googlemail.com with ESMTPSA id i78sm3569548wmc.13.2016.09.21.02.42.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Sep 2016 02:42:32 -0700 (PDT) Subject: Re: BUG #14326: Unexpected status after crash during exclusive backup To: Michael Paquier References: <20160916095448.1421.65742@wrigleys.postgresql.org> Cc: PostgreSQL mailing lists From: Marco Nenciarini Message-ID: <9631d538-cab9-ad0a-1852-9b6fb6d40065@2ndquadrant.it> Date: Wed, 21 Sep 2016 11:42:27 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5SSNijhJDCXHptCfCba2eBbIpeKM6UjoN" X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --5SSNijhJDCXHptCfCba2eBbIpeKM6UjoN From: Marco Nenciarini To: Michael Paquier Cc: PostgreSQL mailing lists Message-ID: <9631d538-cab9-ad0a-1852-9b6fb6d40065@2ndquadrant.it> Subject: Re: [BUGS] BUG #14326: Unexpected status after crash during exclusive backup References: <20160916095448.1421.65742@wrigleys.postgresql.org> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 21/09/16 08:50, Michael Paquier wrote: > On Fri, Sep 16, 2016 at 6:54 PM, wrote: >> The workaround I found to reset this state is to force the instance thro= ugh >> another backup recovery, by starting an exclusive backup, saving the >> backup_label, stopping the backup and restarting the instance with the s= aved >> backup_label in place. >=20 > That's not user-friendly. >=20 I agree, it isn't. But it's the only way to reset that state with the current available tools. Probably, the pg_resetxlog tool could be modified to allow the user to reset that value only. >> I don't know the best way to handle this situation, but at least, I'd li= ke a >> warning message when the instance exits from the crash recovery while >> backupStartPoint is still set. >=20 > So you would get such a warning even when you restore from a backup > willingly, no? That may confuse users. Now, the case you are referring > to is unfortunately a known problem with exclusive backups... There is > no way to make the difference between a node restored from a backup > and a node that crashed while a backup is taken. > And that may be a > reason to make non-exclusive backups more popular because they are > more reliable. You are right, an eventual solution to this issue must not interfere with normal recovery from a backup. To mitigate the effect we could to reset the state of the backupStartPoint field during the pg_start_backup invocation. So, if a backup will be interrupted by a reboot, the instance state will be cleaned during the next backup. Another possibility could be to emit a warning (and maybe reset backupStartPoint value) during the shutdown of an instance that is fully "in production". Regards, Marco --=20 Marco Nenciarini - 2ndQuadrant Italy PostgreSQL Training, Services and Support marco.nenciarini@2ndQuadrant.it | www.2ndQuadrant.it --5SSNijhJDCXHptCfCba2eBbIpeKM6UjoN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJX4lYHAAoJEFifA/AbpVA4ap0P/0svwb0PyeXzFaZH4iZ++4Bq NMzaouRHw9LOwGTaiSNzDcsOY/vpvYkj+L8AteYpl4TvHuRQcv+LEtZBSkyQekji OPy+0w7ExCUCDCWD3tPehAcOgKzm3AI0NrMrsJBXwBQmva5OfC41TrNKT12wzw8/ pJxZZ70jYti7raVuRtFcNOFBdtNvc5ILKE/6t7kO6EcgNCOwKNses5nBeUcqsquo LEn3EFggzVs3JQo4m0Q2S8ft2lTEIHxSGUEWpAdoWq19VcxBjgayJS1NUiE/EYuC 1qrcBg0jfwCLanty1nh8OicZgWY6Yth48ngR77+8qHFd+kXhpMjFIxCmh1yYehCT L5uCsuvSn8Hjh6RWKifSLEj6AbXs9CG12oun57jjFMkHCkKSxNslbXjlEAVTcYyj Yohr3vxmbDauZgv3zuQZDXoxfg4Kdl3uvkSKSY7jWByeVpVrruXwISrZNs/Jzqdx GX+mJ0Glpnq/ivkIY9eKgvhcv7gC7fgmbDrq97fPfRbY32hXIP8TgjnyH72nqPV9 8SMrc9vFz9FNs76cf2KNpZoFXXf3abxB78MhvzUPr8fPMtyNyX+cp0buz/nrG8SJ fiOrs7bs7gAHBxn0oCKcK4UH959HMvT/x2GdN8Jv+omfEpzXxFiiH98Zw12UAc2l 65CGlJIa9u/++BE9ujfs =TC80 -----END PGP SIGNATURE----- --5SSNijhJDCXHptCfCba2eBbIpeKM6UjoN--