Development #68034
Estimer le temps à attendre (ETA) lors d'un migrate_schemas
0%
Description
Quand on faire un restart un logiciel multi-tenant avec migrate_schemas, on a dans journald le défilé des :
août 08 16:49:00 passerelle passerelle-manage[698680]: === Running migrate for tenant tenant1 août 08 16:49:00 passerelle passerelle-manage[698680]: Operations to perform: août 08 16:49:00 passerelle passerelle-manage[698680]: Apply all migrations: ... août 08 16:49:00 passerelle passerelle-manage[698680]: Running migrations: ... août 08 16:49:00 passerelle passerelle-manage[698680]: === Running migrate for tenant tenant2 août 08 16:49:00 passerelle passerelle-manage[698680]: Operations to perform: août 08 16:49:00 passerelle passerelle-manage[698680]: Apply all migrations: ... août 08 16:49:00 passerelle passerelle-manage[698680]: Running migrations: ... août 08 16:49:00 passerelle passerelle-manage[698680]: === Running migrate for tenant tenant3 août 08 16:49:00 passerelle passerelle-manage[698680]: Operations to perform: août 08 16:49:00 passerelle passerelle-manage[698680]: Apply all migrations: ... août 08 16:49:00 passerelle passerelle-manage[698680]: Running migrations: ... août 08 16:49:00 passerelle passerelle-manage[698680]: === Running migrate for tenant tenant4 ...
Sur de grosses migrations c'est assez long... et on aimerait savoir quand ça va se finir.
Comme le temps passé sur chaque tenant est sensiblement le même, et qu'on connaît le nombre de total tenants à migrer, on pourrait certainement afficher un message "ETA: août 08 16:51:00 (in 12 minutes)" après chaque migration. Ca serait sympa.
Fichiers
Révisions associées
Historique
Mis à jour par Thomas Noël il y a plus d'un an
- Fichier 0001-multitenant-show-ETA-on-migrate_schemas-68034.patch 0001-multitenant-show-ETA-on-migrate_schemas-68034.patch ajouté
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
Mis à jour par Thomas Noël il y a plus d'un an
Ca donne ça, visible typiquement dans « journalctl -fu ... »
=== Start migrate_schemas for 2 tenants === Running migrate for tenant host1.com Operations to perform: Apply all migrations: auth, common, contenttypes, environment, mellon, profile, sessions Running migrations: Applying common.0002_auto_20160105_1702... OK Applying common.0003_auto_20200707_1656... OK Applying common.0004_alter_role_uuid... OK === migrate_schemas ETA: 2022-08-08 19:49:33.285230+02:00 === Running migrate for tenant host2.com Operations to perform: Apply all migrations: auth, common, contenttypes, environment, mellon, profile, sessions Running migrations: Applying common.0002_auto_20160105_1702... OK Applying common.0003_auto_20200707_1656... OK Applying common.0004_alter_role_uuid... OK === migrate_schemas ETA: 2022-08-08 19:49:33.277048+02:00
Mis à jour par Frédéric Péters il y a plus d'un an
Il n'y a pas un buffering qui rend un peu pénible le suivi via journalctl -f ?
(ailleurs j'ai Environment=PYTHONUNBUFFERED=1)
Mis à jour par Frédéric Péters il y a plus d'un an
Running migrate for tenant host2.com
Tant qu'à être ici, ajouter un compteur à côté, type "Running migrate for tenant host2.com (4/23)" ?
Mis à jour par Thomas Noël il y a plus d'un an
- Statut changé de Solution proposée à En cours
Frédéric Péters a écrit :
Il n'y a pas un buffering qui rend un peu pénible le suivi via journalctl -f ?
Pas tant que ça, les tenant arrivent par paquet de 4 ou 5, ça passe encore. Mais oui, si on pouvait faire un "flush" comme dans wcs (#63954) ça serait bien.
Je vais regarder ça et l'ajout d'un compteur.
Mis à jour par Thomas Noël il y a plus d'un an
- Fichier 0001-multitenant-show-ETA-on-migrate_schemas-68034.patch 0001-multitenant-show-ETA-on-migrate_schemas-68034.patch ajouté
- Statut changé de En cours à Solution proposée
Voici, avec un compteur et du flush.
Mis à jour par Serghei Mihai il y a plus d'un an
- Statut changé de Solution proposée à Solution validée
Mis à jour par Thomas Noël il y a plus d'un an
- Statut changé de Solution validée à Résolu (à déployer)
commit 420ed17e0758e94dd6687d5ca3870479e08be0fb Author: Thomas NOËL <tnoel@entrouvert.com> Date: Fri Dec 9 11:25:43 2022 +0100 multitenant: show ETA on migrate_schemas (#68034)
Mis à jour par Transition automatique il y a plus d'un an
- Statut changé de Résolu (à déployer) à Solution déployée
multitenant: show ETA on migrate_schemas (#68034)