You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: instanceSidecarConfiguration.env can't override env inherited from the postgres container #1250
An env var set in instanceSidecarConfiguration.env is silently dropped when the postgres container already defines it, so TMPDIR, PGHOST and the other variables CNPG sets on the instance can't be changed for the sidecar.
reconcilePodSpec copies the main container env first and then appends the defaults and config.env only for names not already present, so the inherited value always wins.
Where it hurts: barman-cloud-backup stages every upload part in TMPDIR, which the sidecar inherits as /controller/tmp, the disk-backed scratch-data emptyDir. With the default max-archive-size the parts are ~20 MiB, and with data.jobs: 2 up to five of them are in flight. The sidecar memory cgroup (1Gi here) has a low dirty threshold, so most of the base backup goes through the node disk: on a 36 GB database that's about 10 GB of writes per nightly backup, just for temporary files that get deleted right after upload. Pointing TMPDIR at /dev/shm, which the sidecar already mounts, would avoid it, but the setting is ignored.
to an ObjectStore, restart the instance and look at the plugin-barman-cloud container env: TMPDIR is still /controller/tmp.
I'd expect the explicitly configured env to take precedence over the inherited one. I'll open a PR that merges config.env before the main container envs.
Activity