Skip to content

Commit

Permalink
Remove support for Postgres 11
Browse files Browse the repository at this point in the history
Postgres 11 went out of support in November 2023.

[TPCF-27798]
  • Loading branch information
ystros committed Oct 28, 2024
1 parent ddd4e3d commit 3467179
Show file tree
Hide file tree
Showing 18 changed files with 14 additions and 537 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ Backup and Restore SDK Release status [![Build SDK Release Badge](https://ci.cry
|:---------|:-------------------------|
| MariaDB | 10.2.x |
| MySQL | 5.7.x, 8.0.x |
| Postgres | 9.6.x, 10.x, 11.x |

The SDK can use used against Postgres 9.4, but is not supported upstream by the Postgres community.
| Postgres | 13.x, 15.x |

CI Status:
* GCP: [![GCP Test Badge](https://ci.cryo.cf-app.com/api/v1/teams/bosh-backup-restore/pipelines/backup-and-restore-sdk-release/jobs/system-tests-external-dbs-gcp/badge)](https://ci.cryo.cf-app.com/teams/bosh-backup-restore/pipelines/backup-and-restore-sdk-release/jobs/system-tests-external-dbs-gcp/)
Expand Down
94 changes: 2 additions & 92 deletions ci/pipelines/backup-and-restore-sdk-release/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ secrets:

#! The following external DB creds were needed on 2023-07-03 for testing the BBR SDK with some external databases.
- &external_db_passwords
postgres_11_password: &postgres_11_password ((rds_postgres_11_password))
postgres_13_password: &postgres_13_password ((rds_postgres_13_password))
postgres_15_password: &postgres_15_password ((rds_postgres_15_password))
mariadb_10_password: &mariadb_10_password ((rds_mariadb_10_password))
Expand Down Expand Up @@ -122,17 +121,10 @@ secrets:
- &minio_access_key ((minio_user.username))
- &minio_secret_key ((minio_user.password))

- &postgres_common
POSTGRES_PORT: 5432
POSTGRES_USERNAME: &postgres-username test_user
POSTGRES_PASSWORD: &postgres-password postgres_password
- &pg_deployment_common
db_username: *postgres-username
db_password: *postgres-password

- &postgres-11-deployment-name postgres-11-dev
- &postgres-11-host 10.0.255.13

- &postgres-13-deployment-name postgres-13-dev
- &postgres-13-host 10.0.255.14

Expand Down Expand Up @@ -264,11 +256,6 @@ resources:
source:
url: ftp://ftp.gnu.org/pub/gnu/ncurses/
version_regex: "ncurses-(?P<version>[0-9]*.[0-9]*).tar.gz$"
- name: postgres-11-blob
type: ftp
source:
url: https://ftp.postgresql.org/pub/source/v11.*/
version_regex: postgresql-(?P<version>[0-9]*.[0-9]*).tar.gz$
- name: postgres-13-blob
type: ftp
source:
Expand Down Expand Up @@ -481,12 +468,6 @@ resources:
deployment: *mysql-5-7-deployment-name
skip_check: true

- name: postgres-11-dev-deployment
type: bosh-deployment
source:
deployment: *postgres-11-deployment-name
skip_check: true

- name: postgres-13-dev-deployment
type: bosh-deployment
source:
Expand Down Expand Up @@ -836,23 +817,6 @@ jobs:
input_mapping:
cf-deployment-env: cf-deployment-env-airgapped
- in_parallel:
- put: postgres-11-dev-deployment
params:
manifest: backup-and-restore-sdk-release/ci/manifests/postgres-11.yml
stemcells:
- jammy-stemcell/*.tgz
vars:
deployment-name: *postgres-11-deployment-name
db_host: *postgres-11-host
<<: *pg_deployment_common
availability_zone: z1
vm_extensions: ["cf-tcp-router-network-properties"]
ops_files:
- backup-and-restore-sdk-release/ci/manifests/ops-files/apply_vm_extension.yml
source_file: source-file/source-file.yml
releases:
- postgres-release-v37/*.tgz
- bpm-release/*.tgz
- put: postgres-13-dev-deployment
params:
manifest: backup-and-restore-sdk-release/ci/manifests/postgres-13.yml
Expand Down Expand Up @@ -1008,14 +972,6 @@ jobs:
- load_var: pooled-env
file: bosh-env/metadata.yml
- in_parallel:
- task: postgres-system-tests-11
image: image-cryogenics-essentials
file: backup-and-restore-sdk-release/ci/tasks/sdk-system-db/task.yml
params:
POSTGRES_HOSTNAME: *postgres-11-host
TEST_SUITE_NAME: postgresql
<<: *bosh-smiths-creds
<<: *postgres_common
- task: mysql-8-0-system-tests
image: image-cryogenics-essentials
file: backup-and-restore-sdk-release/ci/tasks/sdk-system-db/task.yml
Expand Down Expand Up @@ -1294,31 +1250,6 @@ jobs:
POSTGRES_PASSWORD: *postgres_15_password
TEST_SSL_USER_REQUIRES_SSL: false
TEST_SUITE_NAME: postgresql_tls
- do:
- task: postgres-system-tests-11
image: image-cryogenics-essentials
file: backup-and-restore-sdk-release/ci/tasks/sdk-system-db/terraform-task.yml
input_mapping:
terraform-state: terraform
params:
<<: *bosh-smiths-creds
DB_PREFIX: postgres_11
DB_TYPE: postgres
POSTGRES_PASSWORD: *postgres_11_password
TEST_SUITE_NAME: postgresql
- task: postgres-tls-system-tests-11
image: image-cryogenics-essentials
file: backup-and-restore-sdk-release/ci/tasks/sdk-system-db/terraform-task.yml
input_mapping:
terraform-state: terraform
params:
<<: *bosh-smiths-creds
DB_PREFIX: postgres_11
DB_TYPE: postgres
POSTGRES_CA_CERT_PATH: rds-combined-ca-bundle.pem
POSTGRES_PASSWORD: *postgres_11_password
TEST_SSL_USER_REQUIRES_SSL: false
TEST_SUITE_NAME: postgresql_tls
- do:
- task: postgres-system-tests-13
image: image-cryogenics-essentials
Expand Down Expand Up @@ -1677,8 +1608,6 @@ jobs:
trigger: true
- get: ncurses-blob
trigger: true
- get: postgres-11-blob
trigger: true
- get: postgres-13-blob
trigger: true
- get: postgres-15-blob
Expand Down Expand Up @@ -1751,25 +1680,6 @@ jobs:
BLOB_EXTENSION: .tar.gz
BLOB_DIRECTORY: ncurses/
UPDATE_REFERENCES: only-variable-name:NCURSES_VERSION
# Postgres 11
- task: bump-postgres-11-blob
image: image-cryogenics-essentials
file: cryogenics-concourse-tasks/deps-automation/bump-blob/task.yml
input_mapping:
distributed-package: postgres-11-blob
bosh-release: backup-and-restore-sdk-release
output_mapping:
bosh-release-updated: backup-and-restore-sdk-release
params:
<<: *AWS_ACCESS
GIT_USERNAME: *github_user
GIT_EMAIL: *github_email
GIT_BRANCH: main
BLOB_NAME: postgresql
BLOB_EXTENSION: .tar.gz
KEEP_BLOBS_FILTER: postgresql-13,postgresql-15
BLOB_DIRECTORY: postgres/
UPDATE_REFERENCES: only-variable-name:POSTGRES_VERSION
# Postgres 13
- task: bump-postgres-13-blob
image: image-cryogenics-essentials
Expand All @@ -1786,7 +1696,7 @@ jobs:
GIT_BRANCH: main
BLOB_NAME: postgresql
BLOB_EXTENSION: .tar.gz
KEEP_BLOBS_FILTER: postgresql-11,postgresql-15
KEEP_BLOBS_FILTER: postgresql-15
BLOB_DIRECTORY: postgres/
UPDATE_REFERENCES: only-variable-name:POSTGRES13_VERSION
# Postgres 15
Expand All @@ -1805,7 +1715,7 @@ jobs:
GIT_BRANCH: main
BLOB_NAME: postgresql
BLOB_EXTENSION: .tar.gz
KEEP_BLOBS_FILTER: postgresql-11,postgresql-13
KEEP_BLOBS_FILTER: postgresql-13
BLOB_DIRECTORY: postgres/
UPDATE_REFERENCES: only-variable-name:POSTGRES15_VERSION
# PCRE2
Expand Down
20 changes: 0 additions & 20 deletions ci/terraform/bbr-sdk-system-tests/aws/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
variable "postgres_11_password" {
type = string
}

variable "postgres_13_password" {
type = string
}
Expand Down Expand Up @@ -31,19 +27,6 @@ variable "aws_region" {
type = string
}

resource "aws_db_instance" "backup_and_restore_postgres_11" {
identifier = "postgres-11-system-tests"
allocated_storage = 20
storage_type = "gp2"
engine = "postgres"
engine_version = "11"
instance_class = "db.t3.micro"
username = "root"
password = var.postgres_11_password
publicly_accessible = true
skip_final_snapshot = true
}

resource "aws_db_instance" "backup_and_restore_postgres_13" {
identifier = "postgres-13-system-tests"
allocated_storage = 20
Expand Down Expand Up @@ -83,9 +66,6 @@ resource "aws_db_instance" "backup_and_restore_mariadb_10_6" {
skip_final_snapshot = true
}

output "postgres_11_address" {
value = aws_db_instance.backup_and_restore_postgres_11.address
}
output "postgres_13_address" {
value = aws_db_instance.backup_and_restore_postgres_13.address
}
Expand Down
4 changes: 0 additions & 4 deletions config/blobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ openssl/openssl-1.1.1w.tar.gz:
size: 9893384
object_id: 8ebd05e7-9a12-4a1c-7a2d-5142e99bbcc0
sha: sha256:cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8
postgres/postgresql-11.22.tar.gz:
size: 26826810
object_id: 00576d0f-f9a2-4210-7db0-f1d1687c3327
sha: sha256:6445a4e1533c1e8bb616d4a3784bdc4c0226b541f6f0c8d996d9f27d581d49c3
postgres/postgresql-13.16.tar.gz:
size: 28320674
object_id: 776b7076-2154-4977-5395-5a727c5d0b8d
Expand Down
2 changes: 1 addition & 1 deletion docs/database-backup-restore.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The SDK accepts a JSON document with the following fields:

#### Supported Database Adapters

* `postgres` (auto-detects versions between `11` and `13`)
* `postgres` (auto-detects versions between `13` and `15`)
* `mysql` (auto-detects `MariaDB 10.1.x`, `MySQL 5.7.x` and `MySQL 8.0.x`. Any other `mysql` variants are not tested)


Expand Down
1 change: 0 additions & 1 deletion jobs/database-backup-restorer/spec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ templates:

packages:
- database-backup-restorer
- database-backup-restorer-postgres-11
- database-backup-restorer-postgres-13
- database-backup-restorer-postgres-15
- database-backup-restorer-mariadb
Expand Down
3 changes: 0 additions & 3 deletions jobs/database-backup-restorer/templates/backup
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@

set -e

export PG_DUMP_11_PATH="/var/vcap/packages/database-backup-restorer-postgres-11/bin/pg_dump"
export PG_RESTORE_11_PATH="/var/vcap/packages/database-backup-restorer-postgres-11/bin/pg_restore"

export PG_DUMP_13_PATH="/var/vcap/packages/database-backup-restorer-postgres-13/bin/pg_dump"
export PG_RESTORE_13_PATH="/var/vcap/packages/database-backup-restorer-postgres-13/bin/pg_restore"

Expand Down
3 changes: 0 additions & 3 deletions jobs/database-backup-restorer/templates/restore
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@

set -e

export PG_DUMP_11_PATH="/var/vcap/packages/database-backup-restorer-postgres-11/bin/pg_dump"
export PG_RESTORE_11_PATH="/var/vcap/packages/database-backup-restorer-postgres-11/bin/pg_restore"

export PG_DUMP_13_PATH="/var/vcap/packages/database-backup-restorer-postgres-13/bin/pg_dump"
export PG_RESTORE_13_PATH="/var/vcap/packages/database-backup-restorer-postgres-13/bin/pg_restore"

Expand Down
47 changes: 0 additions & 47 deletions packages/database-backup-restorer-postgres-11/packaging

This file was deleted.

23 changes: 0 additions & 23 deletions packages/database-backup-restorer-postgres-11/spec

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func main() {
func makeInteractor(isRestoreAction bool, utilitiesConfig config.UtilitiesConfig,
connectionConfig config.ConnectionConfig, tempFolderManager config.TempFolderManager) (database.Interactor, error) {

postgresServerVersionDetector := postgres.NewServerVersionDetector(utilitiesConfig.Postgres11.Client)
postgresServerVersionDetector := postgres.NewServerVersionDetector(utilitiesConfig.Postgres13.Client)
mysqlServerVersionDetector := mysql.NewServerVersionDetector(utilitiesConfig.Mysql57.Client)
interactorFactory := database.NewInteractorFactory(utilitiesConfig, postgresServerVersionDetector, mysqlServerVersionDetector, tempFolderManager)
return interactorFactory.Make(actionLabel(isRestoreAction), connectionConfig)
Expand Down
6 changes: 0 additions & 6 deletions src/database-backup-restore/config/utilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ type UtilityPaths struct {
}

type UtilitiesConfig struct {
Postgres11 UtilityPaths
Postgres13 UtilityPaths
Postgres15 UtilityPaths
Mariadb UtilityPaths
Expand All @@ -32,11 +31,6 @@ func GetUtilitiesConfigFromEnv() UtilitiesConfig {
Dump: lookupEnv("PG_DUMP_13_PATH"),
Restore: lookupEnv("PG_RESTORE_13_PATH"),
},
Postgres11: UtilityPaths{
Client: lookupEnv("PG_CLIENT_PATH"),
Dump: lookupEnv("PG_DUMP_11_PATH"),
Restore: lookupEnv("PG_RESTORE_11_PATH"),
},
Mariadb: UtilityPaths{
Client: lookupEnv("MARIADB_CLIENT_PATH"),
Dump: lookupEnv("MARIADB_DUMP_PATH"),
Expand Down
7 changes: 1 addition & 6 deletions src/database-backup-restore/database/interactor_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,7 @@ func (f InteractorFactory) getAdditionalOptionsProvider(mysqlVersion version.Dat

func (f InteractorFactory) getUtilitiesForPostgres(postgresVersion version.DatabaseServerVersion) (string, string, string, error) {
semVer := postgresVersion.SemanticVersion
if semVer.MajorVersionMatches(version.SemVer("11", "x", "x")) {
return f.utilitiesConfig.Postgres11.Client,
f.utilitiesConfig.Postgres11.Dump,
f.utilitiesConfig.Postgres11.Restore,
nil
} else if semVer.MajorVersionMatches(version.SemVer("13", "x", "x")) {
if semVer.MajorVersionMatches(version.SemVer("13", "x", "x")) {
return f.utilitiesConfig.Postgres13.Client,
f.utilitiesConfig.Postgres13.Dump,
f.utilitiesConfig.Postgres13.Restore,
Expand Down
Loading

0 comments on commit 3467179

Please sign in to comment.