Re: pgsql: Add support for temporary replication slots

From: Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Add support for temporary replication slots
Date: 2016-12-13 00:05:08
Message-ID: 314cae39-2e7d-f5a3-d226-cfb80cf80481@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On 13/12/16 00:39, Tom Lane wrote:
> I wrote:
>> Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com> writes:
>>> Attached is the fixed test using the loop from test_extensions (and yes
>>> I would have missed the pg_stat_clear_snapshot() call without the hint,
>>> thanks :) ).
>
>> Pushed, thanks.
>
> Hm, buildfarm says this didn't fix it. Where exactly does the dropping
> of the slot happen ... is it not complete by the time the backend exits?
>

Yes, I've seen. The cleanup of slots is done in ProcKill(), I wonder,
since it's on_shmem_exit hook, and the pgstat_beshutdown_hook is as
well, maybe the pgstat_beshutdown_hook is called before ProcKill and the
query is lucky to hit right in between.

I am not quite sure what would be the best way to work around that. We
could wait for the slot to disappear instead of trying to drop it, but
then the test would hang on failure.

--
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2016-12-13 00:40:37 Re: pgsql: Add support for temporary replication slots
Previous Message Tom Lane 2016-12-12 23:39:13 Re: pgsql: Add support for temporary replication slots

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2016-12-13 00:33:25 Re: Logical Replication WIP
Previous Message Michael Paquier 2016-12-12 23:44:46 Re: exposing wait events for non-backends (was: Tracking wait event for latches)