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

[12] - Update module issues on 24/7 production environment with table locks #54479

Open
Nimja opened this issue Jul 15, 2020 · 1 comment
Open

Comments

@Nimja
Copy link

Nimja commented Jul 15, 2020

The upgrade process in Odoo currently has a major issue with how it updates the DB.

Setup:

  • 2 modules: module_parent and module_child
  • module_child is dependent on module_parent
  • module_parent has a model: user, with role, not required=False (default).
  • module_child updates that model: user, with role required=True (explicitly set).

If you update PARENT, the following happens:

  • Load modules to update
  • Update module_parent
  • Update the DB, removing the "not null" requirement from user.role (locking the table!)
  • Commit the changes???
  • Update module_child
  • Update the DB, re-adding the "not null" requirement from user.role

The major issue with this is that it becomes impossible to update modules on a large production environment. Because it's very likely (and actually happening) that:

  • A: The table lock on user causes issues with other running processes at the same time.
  • B: There is a period of time where the not null constrained is removed from the DB. If there are many modules to update, this is quite serious!
@cymitearacil
Copy link

This is happening also on Odoo 10 branch. Yesterday I could not deploy on production server because of this issue.

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

No branches or pull requests

2 participants