From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id qHDtIWrBZ1/HBAAA0tVLHw (envelope-from ) for ; Sun, 20 Sep 2020 20:54:02 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id uL+rHWrBZ19LXgAAB5/wlQ (envelope-from ) for ; Sun, 20 Sep 2020 20:54:02 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 143CA9402A3 for ; Sun, 20 Sep 2020 20:54:02 +0000 (UTC) Received: from localhost ([::1]:59204 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kK6LQ-0002dD-NS for larch@yhetil.org; Sun, 20 Sep 2020 16:54:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51940) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kK6LG-0002bV-9T for guix-devel@gnu.org; Sun, 20 Sep 2020 16:53:50 -0400 Received: from flashner.co.il ([178.62.234.194]:42248) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kK6LD-0006u0-Pl; Sun, 20 Sep 2020 16:53:49 -0400 Received: from localhost (unknown [31.210.181.177]) by flashner.co.il (Postfix) with ESMTPSA id 457C140313; Sun, 20 Sep 2020 20:53:45 +0000 (UTC) Date: Sun, 20 Sep 2020 23:53:01 +0300 From: Efraim Flashner To: Marius Bakke Subject: Re: Running service migrations during upgrades Message-ID: <20200920205301.GC6984@E5400> References: <87o8m062r2.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="NKoe5XOeduwbEQHU" Content-Disposition: inline In-Reply-To: <87o8m062r2.fsf@gnu.org> X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Received-SPF: pass client-ip=178.62.234.194; envelope-from=efraim@flashner.co.il; helo=flashner.co.il X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/20 15:15:57 X-ACL-Warn: Detected OS = ??? X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Spam-Score: -1.11 X-TUID: +3ErYsH/0zXR --NKoe5XOeduwbEQHU Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Sep 20, 2020 at 02:39:45PM +0200, Marius Bakke wrote: > Hello Guix, >=20 > Some services require administrator interaction when they are updated. > The most prominent examples here are MySQL/MariaDB and PostgresQL. >=20 > For the former, running 'mysql_upgrade' in-place is generally sufficient > and fairly safe. >=20 > For the latter, the procedure is more involved, and requires making a > full backup, as well as access to the old _and_ new PostgreSQL > packages. >=20 > There is a patch to update MariaDB here: >=20 > https://issues.guix.gnu.org/43355 >=20 > Users of mysql-service-type will need to run 'mysql_upgrade' afterwards. >=20 > I have been considering adding an AUTO-UPGRADE? parameter of > mysql-service-type that runs 'mysql_upgrade' as part of the activation > script. >=20 > Another approach is adding a 'herd upgrade' Shepherd action along with a > news entry describing what to do. Of course it is possible to do both, > having 'auto-upgrade?' _and_ a Shepherd action for manual upgrades. >=20 > Thoughts? >=20 > While that works for MariaDB, I'm not sure what to do about Postgres. > For those unfamiliar, the procedure for upgrading from PostgreSQL 10 > (current default) to 11 (available in Guix) is roughly: >=20 > sudo cp -a /var/lib/postgresql/data /var/lib/postgresql/data10 > sudo -u postgres $(guix build postgresql)/bin/pg_upgrade \ > --old-bindir=3D$(guix build postgresql@10)/bin \ > --new-bindir=3D$(guix build postgresql)/bin \ > --old-datadir=3D/var/lib/postgresql/data10 \ > --new-datadir=3D/var/lib/postgresql/data >=20 > In order to automate it, we need to somehow preserve the "previous" > version of PostgreSQL so that we can reach it when the major version > changes. Or add an 'upgrade-from' parameter to > postgresql-service-type. >=20 > How do other distros deal with this? >=20 It looks like Debian has a whole package named "postgres-common" to deal with updating postgres databases and clusers to newer versions. https://sources.debian.org/src/postgresql-common/ > On a related note, a 'herd backup' action might be a prerequisite for > doing such potentially dangerous operations... >=20 > I will try to add a 'mysql_upgrade' pass to 'mysql-service-type' in time > for the MariaDB upgrade, but tips regarding backups, potential pitfalls, > and especially Postgres welcome. >=20 > PS: I'm mostly busy for some time still, but can be reached on #guix or > by private email if you want my feedback on something. :-) --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --NKoe5XOeduwbEQHU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl9nwSoACgkQQarn3Mo9 g1EFEQ/9FwmmJuA7WgCKrT1EhvIn5yRhw+OaR6MA+5aKFDrsmOQpsAS7jeC46bWG 7gyqb8mkpzrNyarw6MHZ0FKxPWyxLRe/jkaJWZBoWq1c2rAUAAKmp3dnty3Xbd6z FxZT9IUIEhbIL96o5J6fkxXHicYXHVXc3a6wLbZRruJIQ4rEFb+YBo1NXSdP/vGv 8THYbYXRK91IZsWaJR7vw+ur31qmZI2dBA1z6dBymiAbhEx8OgvtWZCIwtzxhhEe TzeSbQqpH3mNatjCtX4i+ZGXikjXzVNNeAgiHA/yUdtb/5/jPxPcITx5XLwD2BHm 8kaAEqXXIJD+zl1iU2lKi1gRzp2330HIM5tCOtOsrGhaXaFvG+kxtMFI2auagj/w 8rDX22hoNRqAI0IS7JYKgqMsgAJk81iXNbQYc7xS4/RWKlOTMSTDmtBBTv0OZ0Dn ws0DMV5MGBoqTAD7iFf/cIHqdo45HjRX6AZMHKL6KsN9MbgwAeBirzU0Fxmpoo82 U8VUp1Kp0//9tHrUp/vfnQzbD+xk0QqdHXLBLEAvzTEdV2p26dvWf0JemkoElMso 69OXxHoUMzN4wrtxjAAmf85gRtpiYCU56f8VcaDXtsrdRNqwwWL+9WLEg+mfM2Sv l8pZj4KxpN8icX2BDhLgvxf8QgMu2oU4zzR7NPL3yteRfeqtBnE= =pphs -----END PGP SIGNATURE----- --NKoe5XOeduwbEQHU--