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

From: Rahila Syed <rahilasyed90(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Anthonin Bonnefoy <anthonin(dot)bonnefoy(at)datadoghq(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Memory context can be its own parent and child in replication command
Date: 2025-04-21 09:47:41
Message-ID: CAH2L28s3i=JecJb5uyGtwt0uHMRqTS26ZJQTGFzScMm7nMuh5A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

So here's a v4 with the test restored.
>

I tested this patch, it fixes the issue reported. It passes Github CI tests.

> already does that, so the only new assert would be in
> MemoryContextCreate.

+1 for adding the assertion to increase the chances of this bug being
caught by memory context infrastructure.

I had the following comment.

Why do we do this:
- MemoryContext old_context;
+ MemoryContext old_context = CurrentMemoryContext;

Instead of implementing it as done in the previous version of this code,
i.e.
old_context = MemoryContextSwitchTo(cmd_context);

Thank you,
Rahila Syed

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2025-04-21 09:49:06 Re: Parallel CREATE INDEX for GIN indexes
Previous Message Dmitry Dolgov 2025-04-21 09:38:25 Re: Changing shared_buffers without restart