From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 6KIQLeqlaF+RCgAA0tVLHw (envelope-from ) for ; Mon, 21 Sep 2020 13:08:58 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id oOLMKOqlaF+rVwAAbx9fmQ (envelope-from ) for ; Mon, 21 Sep 2020 13:08:58 +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 2EC1B9403D6 for ; Mon, 21 Sep 2020 13:08:58 +0000 (UTC) Received: from localhost ([::1]:49888 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKLYu-0000lv-Vf for larch@yhetil.org; Mon, 21 Sep 2020 09:08:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44396) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKLYM-0000jo-Or for guix-devel@gnu.org; Mon, 21 Sep 2020 09:08:22 -0400 Received: from mail-ed1-x543.google.com ([2a00:1450:4864:20::543]:38503) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kKLYK-0007Te-Pl; Mon, 21 Sep 2020 09:08:22 -0400 Received: by mail-ed1-x543.google.com with SMTP id c8so12716147edv.5; Mon, 21 Sep 2020 06:08:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:reply-to:in-reply-to:date :message-id:mime-version; bh=w/ygPuZ+WxzfYwV4rCR7O13+hq1IqtqKvYn2u5QlGlo=; b=UuLDjn93IAl5ni/Qx1geYPGhorHGyB21P4TsOkrXzlBy6x5Nw6xxjzZ/hJn1hNdGWo dfC8CLhMf9ncC/RT0YCF0wqcyeQokS4xZ0sUWf7Zgb376lGvs/sk9YT8Qaz0lymbs+U/ 1J7ZnkPXVKC27d9dGEURYEZTZzd6b8lVmmdd78HIq2+iDvMMh1xQzfGTOXjQsQ8T1WyG rfpOLdfdQ7Iep0+gXreisXQDDU5RSfQ6EPDdvvLQEUIvK4TXP0kc9zeLCti0RLU7/Pcp qkvz3VTUNOkPu7/MJFUWo/NnamloFhUy7wa56Ffe0hvcbU0oh+YWbOlBsZHqkbgqBaaL UuOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :reply-to:in-reply-to:date:message-id:mime-version; bh=w/ygPuZ+WxzfYwV4rCR7O13+hq1IqtqKvYn2u5QlGlo=; b=TGZR08YqEJL6M5iPE1+c2z2BVwIUBk5LXsgOVKQobHuFmZ49MawtwBAqknoe2OTxoq /iKg0g7mkzoodLgdk2fUkhoHzqU87AQy8rHgG2wPYvpIDY29umur3EgToAd6YgbskUTf iaHjkTSL7W4DVj75XzPukafProk+pkhzqwbwHwctwsGAQFFDqUogdVYa3CjzyX5GydTC CRHAOKQNF/peFe9fa1FPvDSU8RwIC8vpha7EjP6g/w+BG8IT4DYJ65knel1A2gzR0KTE X/bWRHDGd2yRbMsFgerOE5dCeH4pY9Gh2JFJL+0xjlU+Yuc4Av6JAhGgpnv5lH6P/9qi /LAQ== X-Gm-Message-State: AOAM532Ycv0kivRHuLlhIkWqZKLXbPokJD/UrbYsRfa/wOLMAKBM1X9l 4qT7y16HYBVWt5pxDoxE4IL8vN36sRY= X-Google-Smtp-Source: ABdhPJxULfkHtFV+YhQ+Iqyls3ix9xnMnxwAYkw9S8GezLPCvWxEf4Ey/yRSNp74BXP0FBxoJPjtlw== X-Received: by 2002:a05:6402:17da:: with SMTP id s26mr52132114edy.221.1600693697839; Mon, 21 Sep 2020 06:08:17 -0700 (PDT) Received: from watership ([91.178.162.244]) by smtp.gmail.com with ESMTPSA id jr9sm8935372ejb.87.2020.09.21.06.08.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2020 06:08:16 -0700 (PDT) References: <87o8m062r2.fsf@gnu.org> User-agent: mu4e 1.4.10; emacs 26.3 From: Alex Sassmannshausen To: Marius Bakke Subject: Re: Running service migrations during upgrades In-reply-to: <87o8m062r2.fsf@gnu.org> Date: Mon, 21 Sep 2020 15:08:15 +0200 Message-ID: <874knrtgzk.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Received-SPF: pass client-ip=2a00:1450:4864:20::543; envelope-from=alex.sassmannshausen@gmail.com; helo=mail-ed1-x543.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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: , Reply-To: alex.sassmannshausen@gmail.com 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=pass header.d=gmail.com header.s=20161025 header.b=UuLDjn93; dmarc=pass (policy=none) header.from=gmail.com; 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: -3.81 X-TUID: 0F1KaLGXwIPs --=-=-= Content-Type: text/plain Hi Marius, Your work and thoughts on the SQL upgrades are very interesting. After the last FOSDEM I wrote up some thoughts about service states and their backups that you may find interesting. https://lists.nongnu.org/archive/html/guix-devel/2020-02/msg00002.html Unfortunately I have not found the time to work on any of this since. But feel free to steal freely any content that proves useful! Best wishes, Alex Marius Bakke writes: > Hello Guix, > > Some services require administrator interaction when they are updated. > The most prominent examples here are MySQL/MariaDB and PostgresQL. > > For the former, running 'mysql_upgrade' in-place is generally sufficient > and fairly safe. > > 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. > > There is a patch to update MariaDB here: > > https://issues.guix.gnu.org/43355 > > Users of mysql-service-type will need to run 'mysql_upgrade' afterwards. > > I have been considering adding an AUTO-UPGRADE? parameter of > mysql-service-type that runs 'mysql_upgrade' as part of the activation > script. > > 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. > > Thoughts? > > 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: > > sudo cp -a /var/lib/postgresql/data /var/lib/postgresql/data10 > sudo -u postgres $(guix build postgresql)/bin/pg_upgrade \ > --old-bindir=$(guix build postgresql@10)/bin \ > --new-bindir=$(guix build postgresql)/bin \ > --old-datadir=/var/lib/postgresql/data10 \ > --new-datadir=/var/lib/postgresql/data > > 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. > > How do other distros deal with this? > > On a related note, a 'herd backup' action might be a prerequisite for > doing such potentially dangerous operations... > > 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. > > 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. :-) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEAREIAB0WIQSaK0Ae0AEGUBWEuqyLxPRHboqOAAUCX2ilvwAKCRCLxPRHboqO AE+vAPsH6uXNDsooI2lJKQ9YbaN0iuezgkHdQX1b7Oc0v+fRXgEAj/yKoCrETS7c haSx/YheIjaerYDBEuKD97bmMHOGBbg= =zcSv -----END PGP SIGNATURE----- --=-=-=--