• Robert Haas's avatar
    Fix resource management bug with replication=database. · 3e0d80fd
    Robert Haas authored
    Commit 0d8c9c12 allowed BASE_BACKUP to
    acquire a ResourceOwner without a transaction so that the backup
    manifest functionality could use a BufFile, but it overlooked the fact
    that when a walsender is used with replication=database, it might have
    a transaction in progress, because in that mode, SQL and replication
    commands can be mixed.  Try to fix things up so that the two cleanup
    mechanisms don't conflict.
    
    Per buildfarm member serinus, which triggered the problem when
    CREATE_REPLICATION_SLOT failed from inside a transaction.  It passed
    on the subsequent run, so evidently the failure doesn't happen every
    time.
    3e0d80fd
walsender.c 103 KB