Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TECH] Migrer la colonne answers.id de INTEGER en BIG INTEGER avec downtime. #3839

Merged

Conversation

octo-topi
Copy link
Contributor

@octo-topi octo-topi commented Dec 15, 2021

🎄 Problème

Le type Integer de l’identifiant de la table answer est limité à 2 147 483 647.
Au 15 mai 2022, 849 079 160 enregistrements sont présents.
Il reste 1 298 404 487 enregistrements libres.

Le maximum d'enregistrements insérés par jour du 1er au 15 mai est 3 009 644.
A ce rythme, il reste approximativement 431 jours pour atteindre cette limite.

🎁 Solution

La valeur maximale du type BigInt est 9 223 372 036 854 775 807.
Migrer le type de l'identifiant vers ce type.

🌟 Remarques

Les temps de traitement constatés sur une infratstructure comparable sont:

  • avec Postgresql 12: 16h;
  • avec Postgresql 13: 15h.

🎅 Pour tester

Environnement de test

Ajouter le repo Scalingo en tant que remote

git remote add bigint-test-scalingo git@ssh.osc-secnum-fr1.scalingo.com:pix-int-to-bigint-test.git 

Pusher la branche sur le repo scalingo

git push --force bigint-test-scalingo tech-migrate-answers-id-bigint-with-downtime:master

Lancer le script

scalingo --region osc-secnum-fr1 --app pix-int-to-bigint-test run --detached node ./scripts/bigint/change-answers-id-type-to-bigint-with-downtime.js

Suivre sa progression

scalingo --region osc-secnum-fr1 --app pix-int-to-bigint-test ps
scalingo --region osc-secnum-fr1 --app pix-int-to-bigint-test logs --follow --filter one-off-9441
scalingo --region osc-secnum-fr1 --app pix-int-to-bigint-test logs --filter one-off-9441 --lines 100000 | grep -v "alive" | sort

@octo-topi octo-topi added Development in progress cross-team Toutes les équipes de dev labels Dec 15, 2021
@octo-topi octo-topi self-assigned this Dec 15, 2021
@pix-service
Copy link
Contributor

@octo-topi octo-topi force-pushed the tech-migrate-answers-id-bigint-with-downtime branch from dbdf7dd to 011dd4e Compare December 15, 2021 20:45
@octo-topi octo-topi closed this Jan 5, 2022
@yahyayouness yahyayouness reopened this Jul 11, 2022
@yahyayouness yahyayouness force-pushed the tech-migrate-answers-id-bigint-with-downtime branch 3 times, most recently from efd9613 to af710a0 Compare July 11, 2022 11:18
@yahyayouness yahyayouness self-assigned this Jul 11, 2022
@yahyayouness yahyayouness force-pushed the tech-migrate-answers-id-bigint-with-downtime branch 12 times, most recently from dfc42ec to e3bd398 Compare July 12, 2022 07:43
@yahyayouness yahyayouness force-pushed the tech-migrate-answers-id-bigint-with-downtime branch from e3bd398 to 92c438c Compare July 12, 2022 08:18
Copy link
Contributor

@francois2metz francois2metz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌹 🌺 💮 🥀 🌷 🌻 🌸 LGTM 🌸 🌻 🌷 🥀 💮 🌺 🌹

@pix-service-auto-merge pix-service-auto-merge force-pushed the tech-migrate-answers-id-bigint-with-downtime branch from 92c438c to 089088e Compare July 19, 2022 08:25
@pix-service-auto-merge pix-service-auto-merge deleted the tech-migrate-answers-id-bigint-with-downtime branch July 19, 2022 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants