Skip to content

docs: add zero-downtime upgrades guide - #5036

Closed
mkleczek wants to merge 1 commit into
PostgREST:mainfrom
mkleczek:push-wkklkmnwrrxr
Closed

mkleczek wants to merge 1 commit into
PostgREST:mainfrom
mkleczek:push-wkklkmnwrrxr

Conversation

@mkleczek

Copy link
Copy Markdown
Collaborator

No description provided.

@mkleczek
mkleczek marked this pull request as draft June 24, 2026 05:32
@mkleczek
mkleczek force-pushed the push-wkklkmnwrrxr branch 4 times, most recently from 508c400 to a4e7904 Compare July 9, 2026 04:07
@steve-chavez

Copy link
Copy Markdown
Member

@mkleczek Please rebase 🙏

Document how to start a replacement PostgREST process on the same public host and port when server-reuseport is enabled.

Include the admin server port requirement and readiness-check sequence so upgrade handovers can be validated before stopping the old process.
@mkleczek
mkleczek force-pushed the push-wkklkmnwrrxr branch from a4e7904 to 7a80683 Compare July 18, 2026 09:29
@taimoorzaeem taimoorzaeem added the docs Only related to documentation label Jul 19, 2026
Comment thread docs/how-tos/zero-downtime-upgrades.rst
Comment on lines +53 to +65
- This works for host and port based servers. It does not apply when
:ref:`server-unix-socket` is used.
- If :ref:`server-reuseport` is disabled, the new process will fail to start
with an address-in-use error and the old process will keep serving requests.
- If :ref:`server-reuseport` is enabled on an operating system that does not
support ``SO_REUSEPORT``, PostgREST will fail to start because the
configuration is not supported on that platform.
- If the new process uses the same :ref:`admin-server-port` as the old process,
it will fail to start because that admin port is already in use.
- Each PostgREST process has its own :ref:`db-pool`. During the handover, the
total possible database connections can temporarily double.
- The old and new processes may both serve requests for a short time. Database
migrations should be compatible with both versions while they overlap.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Putting the most important considerations first. Also removing ones that I think are redundant with the previous paragraphs.

Suggested change
- This works for host and port based servers. It does not apply when
:ref:`server-unix-socket` is used.
- If :ref:`server-reuseport` is disabled, the new process will fail to start
with an address-in-use error and the old process will keep serving requests.
- If :ref:`server-reuseport` is enabled on an operating system that does not
support ``SO_REUSEPORT``, PostgREST will fail to start because the
configuration is not supported on that platform.
- If the new process uses the same :ref:`admin-server-port` as the old process,
it will fail to start because that admin port is already in use.
- Each PostgREST process has its own :ref:`db-pool`. During the handover, the
total possible database connections can temporarily double.
- The old and new processes may both serve requests for a short time. Database
migrations should be compatible with both versions while they overlap.
- Each PostgREST process has its own :ref:`db-pool`. During the handover, the
total possible database connections can temporarily double.
- The old and new processes may both serve requests for a short time. Database
migrations should be compatible with both versions while they overlap.
- This works for host and port based servers. It does not apply when
:ref:`server-unix-socket` is used.

@steve-chavez steve-chavez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This LGTM once the feedback is addressed.

@mkleczek

Copy link
Copy Markdown
Collaborator Author

This LGTM once the feedback is addressed.

Let's discuss if this one should be abandoned in favor of #5112

@steve-chavez

steve-chavez commented Aug 7, 2026

Copy link
Copy Markdown
Member

Since #5112 won't be merged for this release:

@wolfgangwalther

Copy link
Copy Markdown
Member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Only related to documentation

Development

Successfully merging this pull request may close these issues.

4 participants