timescale / helm-charts

Configuration and Documentation to run TimescaleDB in your Kubernetes cluster
Apache License 2.0
263 stars 223 forks source link

Tablespace path mismatch #587

Open 9SliceStudio opened 1 year ago

9SliceStudio commented 1 year ago

What happened?

I defined a set of tablespaces. The folder to host the tablespaces data are created at: /var/lib/postgresql/tablespaces/${tablespace}/data But the post_init.sh script try to create the tablespaces in postgres using a path built as: ${PGDATA}/tablespaces/${tablespace}/data which seems to default to /var/lib/postgresql/data/tablespaces/${tablespace}/data. Hence, post_init script fails to create the tablespaces (with error messages such as:

timescaledb 2023-03-07 21:31:21 UTC [179]: [6407ad29.b3-6] postgres@postgres,app=psql [58P01] STATEMENT:  CREATE TABLESPACE "airflow" LOCATION '/var/lib/postgresql/data/tablespaces/airflow/data';
timescaledb ERROR:  directory "/var/lib/postgresql/data/tablespaces/airflow/data" does not exist

Did you expect to see something different?

I expect both paths (the one during directory creation and the one during tablespace creation) to be the same, and so to have an existing tablespace matching the configuration.

How to reproduce it (as minimally and precisely as possible):

I used terraform to deploy the chart, but should probably happen with classical deployement, here is part of the config (which feel relevant to me):

resource "helm_release" "timescaledb" {
  name             = "timescaledb"
  repository       = "https://charts.timescale.com"
  chart            = "timescaledb-single"
  version          = "0.27.2"

  values = file("values.yaml")
}

Here is the content of the values.yaml file:

persistentVolumes:
  data:
    size: 16Gi
    storageClass: standard
  tablespaces:
    airflow:
      size: 2Gi
      storageClass: standard
  wal:
    size: 4Gi
    storageClass: standard
podManagementPolicy: Parallel
replicaCount: 2
secrets:
  credentials:
    PATRONI_REPLICATION_PASSWORD: ...
    PATRONI_SUPERUSER_PASSWORD: ...
    PATRONI_admin_PASSWORD: ...

Environment

For information, using an older value, such as 0.14.0 don’t produce the bug because the post_init script is not the same.

The regression seems to be introduced by 1ca6c755c94489092265ebb07ee2269a6d9a95d5.

See above.

Client Version: v1.26.1 Kustomize Version: v4.5.7 Server Version: v1.25.3

KinD (Kubernetes in Docker)