Re: WaitForOlderSnapshots refactoring

From: Andres Freund <andres(at)anarazel(dot)de>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WaitForOlderSnapshots refactoring
Date: 2018-08-20 12:39:59
Message-ID: 20180820123959.5tapgkvpsxf3teqs@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2018-08-20 14:35:34 +0200, Peter Eisentraut wrote:
> The attached patch factors out the CREATE INDEX CONCURRENTLY code that
> waits for transactions with older snapshots to finish into a new
> function WaitForOlderSnapshots().

> This refactoring was part of a previously posted REINDEX CONCURRENTLY
> patch. But this code is now also appearing as a copy-and-paste in the
> ATTACH/DETACH PARTITION CONCURRENTLY thread, so it might be worth making
> it an official thing.

I'm doubtful that ATTACH should use this, but I think the refactoring is
a good idea regardless.

> The question is where to put it. This patch just leaves it static in
> indexcmds.c, which doesn't help other uses. A sensible place might be a
> new src/backend/commands/common.c. Or we make it non-static in
> indexcmds.c when the need arises.

Why not move it to procarray.c? Most of the referenced functionality
resides there IIRC.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2018-08-20 12:50:22 Re: ALTER TABLE on system catalogs
Previous Message Peter Eisentraut 2018-08-20 12:38:25 Re: ALTER TABLE on system catalogs