Skip to content

Conversation

@macintushar
Copy link
Member

@macintushar macintushar commented Nov 3, 2025

Description

Fixes the deployment error below:

Error: in 18+, these Docker images are configured to store database data in a

format which is compatible with "pg_ctlcluster" (specifically, using

major-version-specific directory names).  This better reflects how

PostgreSQL itself works, and how upgrades are to be performed.


See also https://github.com/docker-library/postgres/pull/1259⁠


Counter to that, there appears to be PostgreSQL data in:

    /var/lib/postgresql/data (unused mount/volume)


This is usually the result of upgrading the Docker image without

upgrading the underlying database using "pg_upgrade" (which requires both

versions).


The suggested container configuration for 18+ is to place a single mount

at /var/lib/postgresql which will then place PostgreSQL data in a

subdirectory, allowing usage of "pg_upgrade --link" without mount point

boundary issues.


See https://github.com/docker-library/postgres/issues/37⁠ for a (long)

discussion around this process, and suggestions for how to do so.

Related Issue

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • New Connector (Destination or Source Connector)
  • Breaking change (fix or feature that would impact existing functionality)
  • Styling change
  • Documentation update
  • Refactoring
  • Chore

How Has This Been Tested?

Ran the deployment and tested Connectors, Models & Syncs

Checklist:

  • Ensure a branch name is prefixed with feature, bugfix, hotfix, release, style or chore followed by / and branch name e.g feature/add-salesforce-connector
  • Added unit tests for the changes made (if required)
  • Have you made sure the commit messages meets the guidelines?
  • Added relevant screenshots for the changes
  • Have you tested the changes on local/staging?
  • Added the new connector in rollout.rb
  • Have you updated the version number of the gem?
  • Have you ensured that your changes for new connector are documented in the docs repo or relevant documentation files?
  • Have you updated the run time dependency in multiwoven-integrations.gemspec if new gems are added
  • Have you made sure the code you have written follows the best practises to the best of your knowledge?

Summary by CodeRabbit

  • Chores
    • Updated database storage configuration to use a dedicated volume for temporal data.
    • Introduced a new standalone volume for database-related temporal data to improve persistence.
    • Refined global volume declarations; existing Redis storage configuration remains unchanged.

@coderabbitai
Copy link

coderabbitai bot commented Nov 3, 2025

Walkthrough

The docker-compose.yml volume configuration was changed: the PostgreSQL service now mounts a new temporal-pg-data volume at /var/lib/postgresql instead of /var/lib/postgresql/data. Redis and other service definitions remain unchanged; temporal-pg-data is declared in top-level volumes.

Changes

Cohort / File(s) Change Summary
Docker Compose Volume Configuration
docker-compose.yml
Replaced mount path /var/lib/postgresql/data with /var/lib/postgresql for the DB service and introduced a new top-level volume temporal-pg-data, mounted at /var/lib/postgresql. Existing volumes mw-pg-data and mw-redis-data remain declared.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Single declarative config file change; no runtime logic.
  • Pay attention to potential impacts on existing data directories and volume naming in deployments.

Poem

🐰 I hopped through compose with a curious cheer,
I moved some bytes to a new home near,
temporal-pg-data now holds the seed,
PostgreSQL naps where roots proceed,
A tiny hop — persistent cheer! 🥕

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing deployment errors for PostgreSQL 18+ by updating the docker-compose configuration.
Description check ✅ Passed The pull request description follows the template structure with all required sections completed, including a clear explanation of the bug fix, type of change marked, testing details provided, and relevant checklist items addressed.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/compose-yml

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 97aea34 and f930b49.

📒 Files selected for processing (1)
  • docker-compose.yml (2 hunks)
🔇 Additional comments (1)
docker-compose.yml (1)

12-12: Verify .env.example and environment configuration match PostgreSQL 18+ requirements.

A previous review flagged that TEMPORAL_POSTGRESQL_VERSION in .env.example still defaults to 13, which uses /var/lib/postgresql/data as the data directory. However, the mount path changes here require PostgreSQL 18+. This version mismatch creates a breaking change for existing deployments.

Confirm that the following were updated (not visible in this file):

  • .env.example and any other .env* files now set TEMPORAL_POSTGRESQL_VERSION=18 (or appropriate 18+ version)
  • Documentation or migration guide added explaining the PostgreSQL 18 requirement and upgrade steps
  • Any related Helm charts or deployment configurations (if applicable) updated similarly

Also applies to: 55-55, 94-96


Comment @coderabbitai help to get the list of available commands and usage tips.

@macintushar macintushar changed the title fix(CE): fixed deployment errors for postgres >=18 fix(CE): fixed deployment errors for postgres 18+ Nov 3, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
docker-compose.yml (1)

1-96: Consider adding a clarifying comment about the PostgreSQL 18+ requirement.

The changes address PostgreSQL 18+ mount path requirements, but this is not documented in the YAML itself. For future maintainers, adding a brief inline comment (e.g., above the postgresql service or the volumes section) explaining why the mount path is /var/lib/postgresql would improve clarity.

Example comment to add above line 3 or 92:

  # This section is for the Temporal services
+ # Note: PostgreSQL 18+ requires data mounted at /var/lib/postgresql (not /var/lib/postgresql/data)
  postgresql:

Alternatively, add a comment in the volumes section:

# Volumes for the database and redis
+ # PostgreSQL data volumes mounted at /var/lib/postgresql for version 18+ compatibility
  volumes:
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bc249b0 and 97aea34.

📒 Files selected for processing (1)
  • docker-compose.yml (3 hunks)
🔇 Additional comments (1)
docker-compose.yml (1)

94-96: Volume declarations are properly explicit and organized.

The volumes section now explicitly declares all three volumes (temporal-pg-data, mw-pg-data, mw-redis-data), which is clear and maintainable.

- 5432:5432
volumes:
- /var/lib/postgresql/data
- temporal-pg-data:/var/lib/postgresql
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

PostgreSQL volume mount paths correctly updated for version 18+ compatibility.

The changes align with the PR objective: PostgreSQL 18+ images expect a single mount at /var/lib/postgresql rather than /var/lib/postgresql/data to support in-place upgrades with pg_upgrade. Both services (postgresql and db) now use the correct mount paths, with separate volumes (temporal-pg-data and mw-pg-data).

Verify that the PostgreSQL image versions in use support the new mount path:

Also applies to: 55-55


🏁 Script executed:

#!/bin/bash
# Description: Verify PostgreSQL version configuration supports the mount path change.

# Check TEMPORAL_POSTGRESQL_VERSION variable default or in .env
grep -r "TEMPORAL_POSTGRESQL_VERSION" . --include="*.env*" --include="*.sh" --include="Makefile" 2>/dev/null | head -20

# Check db service image version in compose file
grep -A 2 'image: postgres:' docker-compose.yml

Length of output: 158



This will help locate the docker-compose.yml and identify if the PostgreSQL version is actually 13 (which uses `/var/lib/postgresql/data`) or if it's been updated to 18+.

---

🏁 Script executed:

```shell
#!/bin/bash
# Find docker-compose.yml location
fd -name "docker-compose.yml" --type f

# Check if there are multiple compose files or variations
fd -name "docker-compose*.yml" --type f

# Look for version overrides or dynamic configuration
grep -r "TEMPORAL_POSTGRESQL_VERSION" . --include="*.yml" --include="*.yaml" -A 2 -B 2 2>/dev/null | head -40

Length of output: 997



---

🏁 Script executed:

```shell
#!/bin/bash
# View the full docker-compose.yml to see volume mounts and version
cat ./docker-compose.yml

# Also check if there's a .env file with actual version override
if [ -f ./.env ]; then
  echo "=== .env file ===" 
  cat ./.env
fi

# Check git diff or commits for version changes
git log --oneline -20 2>/dev/null || echo "Git history not available"

Length of output: 3412



---

🏁 Script executed:

```shell
#!/bin/bash
# Check if TEMPORAL_POSTGRESQL_VERSION was updated anywhere in the PR
grep -r "TEMPORAL_POSTGRESQL_VERSION.*18" . --include="*.env*" --include="*.yml" --include="*.yaml" --include="*.md" 2>/dev/null

# Check for any version update documentation or migration guides
find . -name "*.md" -type f -exec grep -l "postgres.*18\|TEMPORAL_POSTGRESQL_VERSION" {} \; 2>/dev/null | head -10

# Show contents of main README or CHANGELOG if they mention this
if [ -f ./README.md ]; then
  grep -A 5 -B 5 "postgres\|database\|version" ./README.md | head -50
fi

Length of output: 466


Critical version incompatibility: Mount path change requires PostgreSQL 18+ but default version remains 13.

The changes update volume mount paths to /var/lib/postgresql (compatible with PostgreSQL 18+), but TEMPORAL_POSTGRESQL_VERSION in .env.example still defaults to 13, which uses /var/lib/postgresql/data. This creates a breaking change:

  • PostgreSQL 13 with mount at /var/lib/postgresql will fail to access data
  • Users upgrading will face deployment errors unless they manually set TEMPORAL_POSTGRESQL_VERSION=18
  • No migration path or documentation provided

Required fixes:

  1. Update TEMPORAL_POSTGRESQL_VERSION=18 in .env.example files (currently set to 13)
  2. Add documentation or migration guide explaining the PostgreSQL version requirement
🤖 Prompt for AI Agents
In docker-compose.yml around line 12 the volume mount was changed to
/var/lib/postgresql which requires PostgreSQL 18+, but .env.example still
defaults TEMPORAL_POSTGRESQL_VERSION=13 causing a breaking mismatch; update all
.env.example files to set TEMPORAL_POSTGRESQL_VERSION=18, add a brief note in
the repo README or a new migration doc that calls out the PostgreSQL 18
requirement and explains the upgrade step (set TEMPORAL_POSTGRESQL_VERSION=18
and recreate containers/volumes), and ensure the docker-compose and docs mention
the required path change so users know to adjust their environment before
upgrading.

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.

3 participants