Thread

  1. Re: Memory context can be its own parent and child in replication command

    Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com> — 2025-03-12T09:13:06Z

    I've updated the patch with another approach:
    
    0001: This sets the MemoryContext type to T_Invalid just before adding
    it to the aset freelist, allowing to distinguish between a
    MemoryContext that was placed in the freelist and shouldn't be used,
    and a valid one. The existing MemoryContextIsValid checks will be
    triggered if a MemoryContext in the freelist is used.
    I've also added additional MemoryContextIsValid to make sure the
    MemoryContext restored by a transaction is valid.
    
    0002: Keep the replication command alive when there's an ongoing
    snapshot export. This way, the context restored is valid and can be
    reused. This requires the replication command context to be created
    under the TopMemoryContext.
    
    Regards,
    Anthonin Bonnefoy