Repository navigation
feat(pg:promote): support pg:promote on Advanced-tier databases - #4068
Draft
ekozilforce wants to merge 5 commits into
Draft
ekozilforce wants to merge 5 commits into
ekozilforce wants to merge 5 commits into
Conversation
data-api rejects the legacy /client/v11 wait_status and database endpoints for Advanced-tier databases, so pg:promote failed with not_allowed_on_advanced. For Advanced databases, use the /data/postgres/v1 wait_status endpoint, warn on non-leader pool attachments instead of checking follower status, and skip reattaching the connection-pooling:default pooler.
ekozilforce
force-pushed
the
ekozil/pg-promote-advanced
branch
from
November 12, 2026 12:34
6e72f2e to
b4e0e85
Compare
Platform API is deprecating the raw namespace param on addon-attachment creation. Namespaced Advanced attachments are now sent as namespace_config, both for the promoted attachment and for the alias created for the current DATABASE. Platform only returns the namespace string it built from that config, so it's split back into its key/value pairs and resolves to the same existing namespace. Legacy-tier request bodies are unchanged.
iriberri
reviewed
Nov 17, 2026
| Database cannot be promoted while in state: ${status.message} | ||
|
|
||
| Promoting this database can lead to application errors and outage. Please run ${color.code('heroku pg:wait')} to wait for database to become available. | ||
| Promoting this database can lead to application errors and outage. Please run ${color.code(waitCommand)} to wait for database to become available. |
Contributor
There was a problem hiding this comment.
Can we use this opportunity to get a CX pass for this older sentence?
E.g., as an idea:
Promotion failed: database is currently ${status.message}.
Promoting in this state risks app errors and downtime. Run ${color.code(waitCommand)} to wait until the database is available, or re-run with ${color.code('--force')} to override.
Contributor
Author
There was a problem hiding this comment.
Yeah I'll run it by cx
iriberri
reviewed
Nov 17, 2026
| ux.warn(heredoc(` | ||
| ${color.attachment(currentPooler.name + '_URL')} still points to ${color.addon(current?.addon?.name as string)}. | ||
|
|
||
| ${color.code('heroku pg:promote')} doesn't reattach connection pooling to Advanced-tier databases. |
Contributor
There was a problem hiding this comment.
With Advanced not supporting server-side connection pooling at the moment, we could recommend the customer to detach the pool config var.
Contributor
Author
There was a problem hiding this comment.
This prob should run through cx too, I'll draft something up
coreypurcell
approved these changes
Nov 19, 2026
This branch was successfully deployed
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
data-api rejects the legacy /client/v11 wait_status and database endpoints for Advanced-tier databases, so pg:promote failed with not_allowed_on_advanced. For Advanced databases, use the /data/postgres/v1 wait_status endpoint, warn on non-leader pool attachments instead of checking follower status, and skip reattaching the connection-pooling:default pooler.
Type of Change
Breaking Changes (major semver update)
!after your change type to denote a change that breaks current behaviorFeature Additions (minor semver update)
Patch Updates (patch semver update)
Testing
Notes:
Testing
Notes:
ekozil-dev-privateon the regular data service. Steps 2–5 run againstekozil-dev(dev data service) withHEROKU_DATA_SERVICE=heroku-postgresql-ekozilexported. All of them use./bin/run.jsfrom this branch.ekozil-dev, both databases are Advanced tier:postgresql-ekozil-opaque-41919(PG17) andpostgresql-ekozil-perpendicular-69151(PG18).opaque-41919is the target of an in-progress data migration, so itswait_statusreports waiting. That makes it a natural test for the waiting check.DEBUG=http.namespaceslists the twoekozil-devdatabases' attachments and their namespaces from the Platform API:Starting state on
ekozil-dev:Steps:
1. Classic → Advanced in a Private Space
Setup: a classic
private-0database is attached as DATABASE, and anadvanced-privatedatabase is attached as AMBER. Promote the Advanced database.Result: the classic database gets the COBALT alias, and the Advanced database becomes DATABASE.
2. Advanced over Advanced, targeting the add-on name
Setup: DATABASE is opaque, which also has the CRIMSON alias. Promote perpendicular by its add-on name.
Request body:
Result: the existing CRIMSON alias is reused, the
/data/postgres/v1wait_status returns not waiting, and DATABASE moves to perpendicular with no namespace.3. Namespaced attachment, targeting the attachment name
Setup: create an attachment that uses the leader pool and the owner credential.
Request body:
Result: DATABASE gets the same namespace as PROMOTE_TEST and the same URL, so no new credential was created. There's no follower-pool warning, because the pool is leader.
4. Namespaced DATABASE with no other alias, promoting a database that's waiting
Setup: detach PROMOTE_TEST, so nothing else has DATABASE's namespace. Then promote opaque, which is still waiting on its migration.
Request body for the alias (sent after
GET /addons/bc837405-…to look up the current DATABASE's tier):Result: the ONYX alias is created with DATABASE's exact namespace and URL. Promotion then stops at the wait check and points to
data:pg:wait. DATABASE is unchanged.5.
--forcepast the wait checkRequest body:
Result: the ONYX alias from step 4 is reused, wait_status isn't called, and DATABASE is back on opaque.
Cleanup:
Screenshots (if applicable)
Related Issues
GUS work item: W-20250296