Skip to content

fix: chown timescaledb.control to postgres so hot-forge can hot-patch it#653

Closed
minkimipt wants to merge 1 commit intomasterfrom
danil/fix-timescaledb-control-ownership
Closed

fix: chown timescaledb.control to postgres so hot-forge can hot-patch it#653
minkimipt wants to merge 1 commit intomasterfrom
danil/fix-timescaledb-control-ownership

Conversation

@minkimipt
Copy link
Copy Markdown
Contributor

@minkimipt minkimipt commented Apr 15, 2026

Summary

  • The extension directories are set up with sticky bit (1775, group=postgres), which prevents the postgres user from removing files owned by root even though the directory is group-writable
  • hot-forge replaces files by first calling remove_file then creating a symlink; for .so files this works because they are new version-named files, but timescaledb.control is a fixed-name file installed as root:root by the loader apt package
  • After the hot-forge bundle install, default_version in pg_available_extensions would stay at the image-baked version instead of reflecting the hot-patched version
  • This adds a chown postgres step after installing the timescaledb packages, so hot-forge can remove the file and replace it with a symlink to its live directory

Test plan

  • Build a new image and verify timescaledb.control is postgres-owned: stat /usr/share/postgresql/18/extension/timescaledb.control
  • Install a hot-forge bundle with a newer timescaledb version and verify SELECT default_version FROM pg_available_extensions WHERE name = 'timescaledb' returns the hot-patched version

Related PR https://github.com/timescale/hot-forge/pull/424

The extension directories are set up with sticky bit (mode 1775, group=postgres),
which prevents the postgres user from removing or renaming files owned by root —
even though the directory itself is group-writable.

hot-forge replaces a file by first removing it and then creating a symlink to its
live directory. For .so files this works fine because hot-forge installs them as
new files (new version-named files that didn't previously exist). But
timescaledb.control is a fixed-name file installed by the loader apt package as
root:root, so hot-forge's remove_file call fails with EPERM (sticky bit), and the
file is silently skipped.

By transferring ownership of timescaledb.control to the postgres user, hot-forge
can remove it and create a symlink pointing to its live directory. This allows
default_version in pg_available_extensions to reflect the version that was
hot-patched in, rather than staying at the version baked into the image.
@minkimipt
Copy link
Copy Markdown
Contributor Author

Moving this fix to the private cloud image repo instead — hot-forge is cloud-internal and the change doesn't belong in the public OSS image.

@minkimipt minkimipt closed this Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant