docker-compose: add explicit dependency between postgres containers - #2248
Merged
alxndrsn merged 3 commits intoSep 17, 2026
Merged
Conversation
added 2 commits
September 15, 2026 11:22
This seems to prevent a race condition related to volume creation order: Container central-postgres14-1 Error response from daemon: failed to mkdir /var/lib/docker/volumes/central_postgres14/_data/data: mkdir /var/lib/docker/volumes/central_postgres14/_data/data: file exists This error was seen ~3% of the time when running: * `postgres` container based on `tianon/postgres-upgrade:9.6-to-14` * `postgres14` container based on `pgautoupgrade/pgautoupgrade:17.11-trixie` Given the vague nature of both the error itself, and reproduction circumstances, it seems prudent to introduce this dependency. The dependency itself seems logical, as the `postgres14` container should be waiting for the `postgres` container to create a flag file before PostgreSQL itself starts up. See: * moby/moby#47021 * https://forums.docker.com/t/error-while-creating-mount-source-path-after-docker-desktop-update-to-v4-35/144676
alxndrsn
marked this pull request as ready for review
September 15, 2026 12:37
alxndrsn
commented
Sep 15, 2026
| with: | ||
| node-version-file: test/package.json | ||
| - run: cd test/nginx && npm clean-install --no-audit | ||
| - run: touch ./files/allow-postgres14-upgrade |
Contributor
Author
There was a problem hiding this comment.
This is now required as starting the service container triggers starting the postgres14 container, which now triggers starting this postgres container.
lognaturel
approved these changes
Sep 15, 2026
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.
This PR contains work foundational to:
This seems to prevent a race condition related to volume creation order:
This error was seen ~3% of the time when running:
postgrescontainer based ontianon/postgres-upgrade:9.6-to-14postgres14container based onpgautoupgrade/pgautoupgrade:17.11-trixieGiven the vague nature of both the error itself, and reproduction circumstances, it seems prudent to introduce this dependency.
The dependency itself seems logical, as the
postgres14container should be waiting for thepostgrescontainer to create a flag file before PostgreSQL itself starts up.See:
What has been done to verify that this works as intended?
Why is this the best possible solution? Were any other approaches considered?
Could just ignore it, and hope it never happens to a self-hoster.
How does this change impact users? Describe intentional behavior changes from code updates. What are the regression risks?
Should prevent container failure. It's unknown if the failure is temporary, or permanent.
Is this change user-facing or otherwise noteworthy to users? If so, please add an entry for it in CHANGELOG.md.
There's no evidence a user has ever experienced this, so it's unclear if it's helpful to add to the CHANGELOG.
Does this change require updates to documentation? If so, please file an issue here and include the link below.
Probably not.