stellar / go

Stellar's public monorepo of go code
https://stellar.org/developers
Apache License 2.0
1.31k stars 499 forks source link

services/horizon: upgrade psql support to most recent versions #4831

Open mollykarcher opened 1 year ago

mollykarcher commented 1 year ago

What would you like to see?

RDS has very recently added support for psql15, so we're quite a few major versions behind at this point. We should support (at a minimum) the last 2 major versions, which is this case would be psql 14 and psql 15. However, we'll likely want to go back further with postgres (for CI/testing purposes in this repo). Because we build apt packages for ubuntu 20.04 and 22.04, and those distros ship with postgres 12 and 14, respectively, we should make sure we're still running tests against 12+

We currently do not have alignment on which version of psql we support, test against, and deploy. We should sync all of these references up as part of this upgrade process as well. Current state is:

The scope of this issue will cover:

What alternatives are there?

mollykarcher commented 8 months ago

Note that now (when we're pulling this in) psql 16 is the most recent version of postgres, so this is the version we should upgrade to. Psql 16 is supposed to have performance improvements to the COPY function, which is now how ingestion works.

tamirms commented 8 months ago

We should do a performance comparison between the new postgres 16 cluster and the current postgres 12 staging cluster. The performance comparison should include both latest ledger ingestion with traffic mirroring enabled and historical reingestion (e.g. on a period of 24 hours worth of ledgers).

We'll want to examine the following horizon metrics:

We should also look at the postgres metrics dashboard to observe if there are any differences between the two postgres DBs.

Finally, we should look at the AWS RDS performance insights Top SQL dashboard and the metrics dashboard (particularly CPU utilization) for the two DBs.

mollykarcher commented 5 months ago

Due to performance regressions noted on psql16, we are deferring this until after the truncation.