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

Upgrade postgres version on all RDS instances #41

Open
Tracked by #816
1t5j0y opened this issue Aug 30, 2024 · 14 comments
Open
Tracked by #816

Upgrade postgres version on all RDS instances #41

1t5j0y opened this issue Aug 30, 2024 · 14 comments
Assignees

Comments

@1t5j0y
Copy link
Contributor

1t5j0y commented Aug 30, 2024

Postgres 12 is EOL in Nov 2024 and AWS RDS stops support on Feb 28, 2025 after which there will be additional extended support charges for running this version of postgres.

Extended support charges - 0.114/vCPU-hour for years 1 and 2; 0.228/vCPU-hour for year 3
This works out to 10 (current RDS vCPUs) * 0.114 * 730 (hours in month) = Additional $830 + tax / month

AC:

  1. Determine best version to migrate to - preferably latest (17)
  2. Upgrade RDS instances (Avni and RWB)
  3. Upgrade Staging and Prerelease env DBs as well

Output

https://github.com/avniproject/data-fixes/blob/main/all/upgradeAvniPostgresServersTo16.md

Not included in this scope

  • Upgradation of Reporting DB RDS, as there is another card, which would be better to use based on timeline discussions and avoiding repetition of testing and deployment effort.
@github-project-automation github-project-automation bot moved this to New Issues in Avni Product Aug 30, 2024
@1t5j0y 1t5j0y changed the title Upgrade postgres version for all RDS instances Upgrade postgres version on all RDS instances Aug 30, 2024
@himeshr himeshr moved this from New Issues to Focus Items in Avni Product Sep 16, 2024
@himeshr himeshr moved this from Focus Items to Ready in Avni Product Sep 16, 2024
@himeshr himeshr self-assigned this Oct 25, 2024
@himeshr himeshr moved this from Ready to In Progress in Avni Product Oct 25, 2024
@himeshr
Copy link
Contributor

himeshr commented Oct 25, 2024

PG Extensions used by Avni:

openchs=> SELECT * FROM pg_extension;
   oid    |  extname  | extowner | extnamespace | extrelocatable | extversion | extconfig | extcondition
----------+-----------+----------+--------------+----------------+------------+-----------+--------------
    16403 | plpgsql   |       10 |           11 | f              | 1.0        |           |
    16408 | hstore    |       10 |        16402 | t              | 1.4        |           |
    16409 | ltree     |       10 |        16402 | t              | 1.1        |           |
    16410 | tablefunc |       10 |        16402 | t              | 1.0        |           |
    16411 | uuid-ossp |       10 |        16402 | t              | 1.1        |           |
 94143243 | dblink    |       10 |        16402 | t              | 1.2        |           |
(6 rows)

@himeshr
Copy link
Contributor

himeshr commented Oct 25, 2024

Targeting Major version 16.3

@himeshr
Copy link
Contributor

himeshr commented Oct 28, 2024

  • Use 16.3 parameter-group "openchs-postgres-modified-16" for all RDS, except for read-replica
    • rds.force_ssl => 0
  • Use modified 16.3 parameter-group "openchs-postgres-read-modified-16" for prod-read-replica with following additional properties
    • hot_standby_feedback => 1
    • log_min_duration_statement => 20000
    • rds.force_ssl => 0

@himeshr
Copy link
Contributor

himeshr commented Nov 4, 2024

Suggestion received regarding reporting testing:

Create duplicate reporting server instances and modify /etc/hostnames file to point to prod-dup-16-version rds and get sanity testing done.

@himeshr
Copy link
Contributor

himeshr commented Nov 5, 2024

Local upgraded postgres 16 server tests for following repos completed successfully:

  • avni-server
  • avni-etl //Except for 1 expected error NoIAMAuthServiceTest > getUserForTokenShouldFailIfImproperlyConfigured()
  • integration-service

@himeshr himeshr moved this from In Progress to Hold in Avni Product Nov 5, 2024
himeshr added a commit to avniproject/integration-service that referenced this issue Nov 11, 2024
himeshr added a commit to avniproject/integration-service that referenced this issue Nov 11, 2024
himeshr added a commit to avniproject/avni-etl that referenced this issue Nov 18, 2024
himeshr added a commit to avniproject/avni-etl that referenced this issue Nov 18, 2024
@himeshr
Copy link
Contributor

himeshr commented Nov 19, 2024

himeshr added a commit to avniproject/integration-service that referenced this issue Nov 19, 2024
himeshr added a commit that referenced this issue Nov 19, 2024
@himeshr
Copy link
Contributor

himeshr commented Nov 19, 2024

Notes:

  • Assigned public ip to prerelease green db to be able to do traffic redirects
  • Added /etc/hosts redirects in superset(container), jasper and metabase(container) green environments to redirect all prod db traffic to prerelease db green
  • Increased prerelease ETL job gap to 600 minutes instead of prev 60 minutes
  • Configured prerelease ETL to point to prereleasedb-green manually (Avoiding changes in infra, to avoid avni-server and etl permanent issues)
  • cleared org schema etl for all orgs and retriggered ETL
  • Created AWS SG for prerelease db access sg-046cd3bcef0ac4e19 , should be removed later
    Testing urls:
    Jasper - Yenepoya => /yenepoya__ETL_/Reports/Linelists/Blood_glucose_levels_in_Diabetic_patients_Line_list
    Superset - APFOdisha => [Phase 2][APFODISHA] Full vs Complete Vaccination
    Metabase - Ashwini

@dinesh2096
Copy link

Done testing for metabase and superset

@himeshr
Copy link
Contributor

himeshr commented Nov 25, 2024

*) Received feedback from Dinesh that, sanity testing completed successfully for reporting servers using the Postgres 16 DB, for

  • Metabase
  • Superset
  • Jasper

*) Also, ETL tests across multiple organisations ran successfully on Postgres 16 DB, without any new issues reported.

@dinesh2096
Copy link

Done Sanity testing for Jasper

@vedfordev vedfordev moved this from In Progress to Code Review Ready in Avni Product Dec 4, 2024
@vedfordev vedfordev moved this from Code Review Ready to In Progress in Avni Product Dec 4, 2024
@himeshr
Copy link
Contributor

himeshr commented Dec 6, 2024

Upgraded Prerelease DB to version 16 on 05 Dec 2024, 6pm IST

@himeshr himeshr moved this from In Progress to Further Action Required in Avni Product Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Further Action Required
Development

No branches or pull requests

3 participants