Re: Memory context can be its own parent and child in replication command - Mailing list pgsql-hackers

From Rahila Syed
Subject Re: Memory context can be its own parent and child in replication command
Date
Msg-id CAH2L28s3i=JecJb5uyGtwt0uHMRqTS26ZJQTGFzScMm7nMuh5A@mail.gmail.com
Whole thread Raw
In response to Re: Memory context can be its own parent and child in replication command  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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
 

pgsql-hackers by date:

Previous
From: Dmitry Dolgov
Date:
Subject: Re: Changing shared_buffers without restart
Next
From: Tomas Vondra
Date:
Subject: Re: Parallel CREATE INDEX for GIN indexes