fix: chown timescaledb.control to postgres so hot-forge can hot-patch it#653
Closed
fix: chown timescaledb.control to postgres so hot-forge can hot-patch it#653
Conversation
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.
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
1775, group=postgres), which prevents the postgres user from removing files owned by root even though the directory is group-writableremove_filethen creating a symlink; for.sofiles this works because they are new version-named files, buttimescaledb.controlis a fixed-name file installed asroot:rootby the loader apt packagedefault_versioninpg_available_extensionswould stay at the image-baked version instead of reflecting the hot-patched versionchown postgresstep after installing the timescaledb packages, so hot-forge can remove the file and replace it with a symlink to its live directoryTest plan
timescaledb.controlis postgres-owned:stat /usr/share/postgresql/18/extension/timescaledb.controlSELECT default_version FROM pg_available_extensions WHERE name = 'timescaledb'returns the hot-patched versionRelated PR https://github.com/timescale/hot-forge/pull/424