-
Notifications
You must be signed in to change notification settings - Fork 5
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
downgrade PostgreSQL to v13.x [MARXAN-1664] #1148
downgrade PostgreSQL to v13.x [MARXAN-1664] #1148
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
LGTM I was waiting on a reply from their side to move forward with the infra work on our end. |
btw we should validate that Azure Postgres thingy has the other plugins we need. |
In Azure Flexible Server for PostgreSQL v13 (https://docs.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-extensions#postgres-13-extensions):
As far as I can see, @aagm do you see any issues with this? |
73ff46f
to
1c9f448
Compare
1c9f448
to
bd55cd7
Compare
bd55cd7
to
e4737fa
Compare
so @aagm @tiagojsag I don't understand this:
what seems to fail in several tests is an attempt to insert into a calculated column, for which the error in PG13 is (when doing something similar via
however, the same operation does likewise (and thankfully) lead to an error in PG14:
And in both cases, given the hint provided by PG14, inserting into a generated column with a So, this is more of an update on this task: in case there's something obvious that jumps to your eyes, please let me know, otherwise I'll get into overdrive mode trying to understand what's breaking so miserably. Lastly, this is not "just" a failure artifact related to tests only: given that all the failing tests are related to project cloning/export/import, I could confirm that these operations succeed (in general 🙄) in instances running on PG14 but not on instances (aka my local env, for now) running on PG13. |
nvm, I've caught the hicckup in docker logs and I know how to avoid this - we need to tell TypeOrm to never even bother trying to include the generated column in |
so, all the hiccups related to that generated column are fixed now, and we're left with a single regression:
which seems weird, because this should be essentially I'd be tempted to surrender to this one and update the expectation in the failing test, especially as visual inspection of protected area tiles in an instance with pg13 doesn't show anything that looks off, but I'll leave this for Monday - @aagm please feel free to suggest if we should investigate this regression further. |
ecdd56a
to
2fb6a69
Compare
2fb6a69
to
7751391
Compare
@aagm @tiagojsag pragmatically trying to close these PG14->PG13 downgrade checks, I am personally happy-ish to go ahead with the down-up-grade by updating the only failing expectation: 7751391 It would be worth understanding why PostGIS 3.2 calculates things differently than PostGIS 3.1 (tests pass, untouched, when using PostgreSQL13+PostGIS3.1 instead of PostgreSQL13+PostGIS3.2 as base image: https://github.com/Vizzuality/marxan-cloud/actions/runs/2611259505) - but 1. I don't think it's a battle worth fighting now, 2. I kinda trust that PostGIS does the right thing in any case, and 3. my focus in this spike was to make sure that a downgrade to PostgreSQL 13 would not cause operational issues or require us to rewrite un-manageable portions of the application's code, so I think we could live with discrepancies in how some things are calculated. If needed (from a science point of view) we can try to dig further into calculation discrepancies later. I'd merge this PR at the end of the day today unless either of you thinks we should take the originally failing test as a red flag. |
Part of spike to check if all works as expected (bar any tolerable performance regressions) if we run both apidb and geodb on PostgreSQL v13, in preparation to moving the database instances in k8s setups to the Azure database for PostgreSQL Flexible service, which currently supports PostgreSQL up to version 13. We have been using PostGIS v3.1 so far, and this PR also bumps up PostGIS to v3.2 (as this is the version currently supported in the PostgreSQL v13 Azure managed service). In theory, functional regressions are not expected with this downgrade of PostgreSQL, as the key functionality needed for vector tiles is provided by PostGIS v3.x and we're keeping (and actually bumping up) this extension's version. Some performance regressions are expected, instead, with the PostgreSQL downgrade at least in terms of some lesser parallelization of queries in some cases: the assumption here is however that we may be trading some tolerable performance regressions in some cases with the ability to run the PostgreSQL databases on the Azure managed service, which provide both functional advantages (backups, restores, other managed affordances) as well as the ability to potentially use read replicas in the future to better balance read loads.
`tablefunc` functions are not currently used, and this extension is not available in the Azure Database for PostgreSQL - Flexible Server (PostgreSQL v13), so we should be able to safely avoid the use of this extension altogether.
The expectation was toEqual(17) originally; when switching from PostgreSQL 14+PostGIS 3.1 to PostgreSQL 13+PostGIS 3.2 (to match the versions available in Azure Database for PostgreSQL - Flexible Server), processing of the features leads to a count of 18 features (this is due, specifically, to the PostGIS 3.1->3.2 part of the down-up-grade).
7751391
to
2bd14f4
Compare
DO NOT MERGE: even if/when we are happy with these changes after having magnificently verified everything for functional and performance regressions, we should keep these changes in a parallel universe of a PR stack that includes changes needed for infra/tf, so that we can keep fast-tracking urgent changes into
develop
in the meanwhile for any fixes that may be needed for instances where demos/training sessions are running.https://vizzuality.atlassian.net/browse/MARXAN-1664
Part of spike to check if all works as expected (bar any tolerable performance regressions) if we run both apidb and geodb on PostgreSQL v13, in preparation to moving the database instances in k8s setups to the Azure database for PostgreSQL Flexible service, which currently supports PostgreSQL up to version 13.
We have been using PostGIS v3.1 so far, and this PR also bumps up PostGIS to v3.2 (as this is the version currently supported in the PostgreSQL v13 Azure managed service).
In theory, functional regressions are not expected with this downgrade of PostgreSQL, as the key functionality needed for vector tiles is provided by PostGIS v3.x and we're keeping (and actually bumping up) this extension's version.
Some performance regressions are expected, instead, with the PostgreSQL downgrade at least in terms of some lesser parallelization of queries in some cases: the assumption here is however that we may be trading some tolerable performance regressions in some cases with the ability to run the PostgreSQL databases on the Azure managed service, which provide both functional advantages (backups, restores, other managed affordances) as well as the ability to potentially use read replicas in
the future to better balance read loads.