From: Alex Sassmannshausen <alex.sassmannshausen@gmail.com>
To: Marius Bakke <marius@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: Running service migrations during upgrades
Date: Mon, 21 Sep 2020 15:08:15 +0200 [thread overview]
Message-ID: <874knrtgzk.fsf@gmail.com> (raw)
In-Reply-To: <87o8m062r2.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 2652 bytes --]
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 <marius@gnu.org> 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. :-)
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]
next prev parent reply other threads:[~2020-09-21 13:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-20 12:39 Running service migrations during upgrades Marius Bakke
2020-09-20 20:53 ` Efraim Flashner
2020-09-21 13:08 ` Alex Sassmannshausen [this message]
2020-09-30 17:33 ` Ludovic Courtès
2020-10-02 18:56 ` Christopher Baines
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874knrtgzk.fsf@gmail.com \
--to=alex.sassmannshausen@gmail.com \
--cc=guix-devel@gnu.org \
--cc=marius@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.