[Koha-devel] Rolling DB upgrades

Joonas Kylmälä joonas.kylmala at helsinki.fi
Wed Mar 3 09:44:57 CET 2021


Hi

On 02/03/2021 17:56, Julian Maurice wrote:
> Does it mean that the application (Perl) code should be aware of that
> intermediary state where both columns exist at the same time ? If so,
> for how long should it be aware of that old database state ?

Yup. And answer to the second question: as long as the DB migration
takes, sometimes just a few seconds, sometimes hours (we had e.g. some
character encoding change in biblio metadata table if I'm not mistaken
and it took a loong time).

> Does it mean that, for every database schema update, you have to do
> something like this:
> - git reset --hard commit_for_1st_step
> - updatedatabase (add new column) && reload starman
> - git reset --hard commit_for_2nd_step
> - updatedatabase (remove old column) && reload starman
> ?

If you just do the reload starman before updatedatabase then yeah, I
think this represents the idea :) I found more verbose explanation from
here:
http://alexandre-masselot.blogspot.com/2012/08/continuous-deployment-in-perl-code-folks.html

> 
> Do you know another open source software that allows rolling upgrade ?
> It seems like a great idea, but from what I just read online it looks
> really hard to do it correctly.

I don't know any other software but not sure it is that difficult. What
I gather, we could use e.g. Jenkins to push the code / new debian
package that would be created for every commit. Jenkins would make sure
db schema migration is finished before installing a newer version and
the steps would be repeated until we are at the latest release.

And I want to add to to the other email I sent earlier, to clarify the
non-distributed setup for David: the one node setup would probably be
best to be done in the current fashion, shutdown koha, run all db
migrations, start koha. It seems hacky and useless to try do
downtimeless migration with that given you also don't care the service
being down during HW maintanance, etc.

Joonas

-- 
Joonas Kylmälä
Tietojärjestelmäasiantuntija

Kansalliskirjasto
Kirjastoverkkopalvelut
PL 15 (Unioninkatu 36)
00014 Helsingin yliopisto


More information about the Koha-devel mailing list