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

Lors de la migration des pjs, détruit les blobs qui n'existent pas dans l'espace de stockage #9523

Merged
merged 1 commit into from
Oct 10, 2023

Conversation

LeSim
Copy link
Member

@LeSim LeSim commented Sep 27, 2023

No description provided.

@what-the-diff
Copy link

what-the-diff bot commented Sep 27, 2023

PR Summary

  • Improved Robustness for pjs_migration_job.rb
    In order to improve the stability of our system, a safety measure has been introduced in the pjs_migration_job.rb file. This improvement addresses the case when the system encounters a Fog::OpenStack::Storage::NotFound error. The error handling procedure now involves getting rid of a specific temporary data unit, referred as blob, which potentially may have caused the problem, allowing the system to continue operating without interruption. This change means fewer disruptions and a smoother experience for our users.

Copy link
Member

@colinux colinux left a comment

Choose a reason for hiding this comment

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

Si le blob a encore un attachment, ça va provoquer ActiveRecord::InvalidForeignKey: ActiveRecord::InvalidForeignKey

A la place :
blob.attachments.destroy_all va enqueue les PurgeJob qui supprimera le blob, et sera NOOP en essayant de le supprimer sur le stockage vu qu'il n'existe pas

Par contre ça veut dire que théoriquement des dossiers deviendront invalides s'ils manquent une PJ obligatoire. En théorie ça pourrait même échouer si ça joue les validations sur le modèle attaché qui valident la présence d'un attachment

Je sais pas quel est le moins pire.

@LeSim
Copy link
Member Author

LeSim commented Sep 28, 2023

Bien vu. Je tente le blob.attachments.destroy_all dans un premier temps.

On aura après une meilleure vue de combien de dossier sont invalides. et dans ce cas, je passe que je passerai avec un
blob.attachements.delete_all blob.delete

Qu'est ce que tu en penses ?

@LeSim LeSim force-pushed the destroy_blob_not_found_in_migrations branch from e0dc0bd to e9e3cb3 Compare September 28, 2023 08:40
@LeSim LeSim force-pushed the destroy_blob_not_found_in_migrations branch from e9e3cb3 to 23b68fa Compare September 28, 2023 08:41
Copy link
Member

@colinux colinux left a comment

Choose a reason for hiding this comment

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

OK ça me paraît un bon plan, étant donné que les dossiers concernés devraient être assez anciens

@LeSim LeSim added this pull request to the merge queue Oct 10, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 10, 2023
@LeSim LeSim added this pull request to the merge queue Oct 10, 2023
Merged via the queue into main with commit 34dcf4a Oct 10, 2023
15 checks passed
@LeSim LeSim deleted the destroy_blob_not_found_in_migrations branch October 10, 2023 11:01
@sentry-io
Copy link

sentry-io bot commented Oct 10, 2023

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ **NoMethodError: undefined method attachment_reflections' for nil:NilClass (NoMethodError)** PjsMigrationJob` View Issue

Did you find this useful? React with a 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants