Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 706cbed
Choose a base ref
...
head repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c94488f
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Apr 21, 2025

  1. Use the same cmd_context throughout a walsender's lifetime.

    exec_replication_command created a cmd_context to work in and
    then deleted it on exit.  This is pretty dangerous because
    some replication commands start/finish transactions.  In the
    wake of commit 1afe31f, that could lead to restoring a
    CurrentMemoryContext that's already been deleted (and maybe
    even reassigned, leading to hilarity such as a memory context
    that is its own parent).
    
    To fix, let's make the cmd_context persist across
    exec_replication_command calls; instead of deleting it, we'll just
    reset it each time.  In this way it retains the same identity and
    there's no problem if transaction abort restores it as the working
    context.  It probably even saves a few microseconds to do this.
    
    This fix also ensures that exec_replication_command returns to the
    caller (PostgresMain) with the same context active that had been
    when it was called (probably MessageContext).  The previous
    coding could get that wrong too.
    
    Reported-by: Anthonin Bonnefoy <[email protected]>
    Author: Anthonin Bonnefoy <[email protected]>
    Reviewed-by: Tom Lane <[email protected]>
    Discussion: https://postgr.es/m/CAO6_XqoJA7-_G6t7Uqe5nWF3nj+QBGn4F6Ptp=rUGDr0zo+KvA@mail.gmail.com
    tglsfdc authored and Commitfest Bot committed Apr 21, 2025
    Configuration menu
    Copy the full SHA
    3c2b965 View commit details
    Browse the repository at this point in the history
  2. [CF 5637] v4 - Memory context can be its own parent and child in repl…

    …ication command
    
    This branch was automatically generated by a robot using patches from an
    email thread registered at:
    
    https://commitfest.postgresql.org/patch/5637
    
    The branch will be overwritten each time a new patch version is posted to
    the thread, and also periodically to check for bitrot caused by changes
    on the master branch.
    
    Patch(es): https://www.postgresql.org/message-id/[email protected]
    Author(s): Anthonin Bonnefoy
    Commitfest Bot committed Apr 21, 2025
    Configuration menu
    Copy the full SHA
    c94488f View commit details
    Browse the repository at this point in the history
Loading