Older Kuma CP Fails on Restart After Newer Database Migration
Opened this issue · 1 comments
vermdeep commented
What happened?
After running a newer database migration, Kuma CP instances running on an older version fail to start if restarted. The following error is encountered:
ERROR kuma-cp.run unable to set up Control Plane runtime {"error": "database is not migrated. Run \"kuma-cp migrate up\" to update database to the newest schema"}
Expected Behavior
Database migrations are expected to be backward compatible. An older version of Kuma CP should not crash on restart due to a newer migration.
We should check here if database is older version instead:
https://github.com/kumahq/kuma/blob/master/pkg/plugins/resources/postgres/migrate.go#L91
return dbVer < fileVer, nil
lobkovilya commented
Triage: database schema should be backwards compatible for 2 versions back https://kuma.io/docs/2.9.x/production/upgrades-tuning/upgrades/#upgrade-kuma. We should take this into account when implementing the check