KiweeEu / magento2-on-kubernetes

🥝 Configuration to deploy Magento® in a Kubernetes cluster
https://kiwee.eu/magento-2-on-kubernetes/
MIT License
87 stars 47 forks source link

Can we achieve Zero down time when there is setup:upgrade is happening #225

Closed Naveen-LinuxAwsguy closed 5 months ago

Naveen-LinuxAwsguy commented 7 months ago

is there any way we can achieve Zero downtime when we are upgrading the DB ?

macieklewkowicz commented 7 months ago

It should be possible, however not with vanilla Magento.

When there's anything to update in the database, setup:upgrade and app:config:import are performed automatically on Magento Pod initialization (https://github.com/KiweeEu/magento2-on-kubernetes/blob/2.4.6-p4-3/deploy/bases/app/magento-web.yaml#L90-L105). This would be sufficient to allow zero-downtime deployments if not for how Magento handles schema and data updates.

Because by default Magento displays an error on all pages when any schema versions in the database don't match those in the code, the new version won't work before setup:upgrade, and the old version breaks as soon as setup:upgrade is performed.

This means that you can either:

Naveen-LinuxAwsguy commented 5 months ago

issue resolved