pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Arthur Zakirov <a.zakirov@postgrespro.ru>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Ildus Kurbangaliev <i.kurbangaliev@postgrespro.ru>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: [PROPOSAL] Shared Ispell dictionaries
Date: Mon, 26 Mar 2018 11:27:48 -0400
Message-ID: <27296.1522078068@sss.pgh.pa.us> (raw)
In-Reply-To: <20180325205408.GA19457@arthur.localdomain>
References: <d4d52484-e269-9d7b-cef5-c1e95a03d9c6@2ndquadrant.com>
	<20180319110648.GA32319@zakirov.localdomain>
	<2ae9588a-f3cb-777d-1958-c76c22225823@2ndquadrant.com>
	<20180320131149.GA12884@zakirov.localdomain>
	<ebcb7f9d-eec2-3138-efde-af83b6a0f04f@2ndquadrant.com>
	<20180321090050.GA21751@zakirov.localdomain>
	<20180322105603.GA23544@zakirov.localdomain>
	<28250.1521924996@sss.pgh.pa.us>
	<ada73d07-6c88-acab-7e31-75b2eb724d24@2ndquadrant.com>
	<25186.1521951490@sss.pgh.pa.us>
	<20180325205408.GA19457@arthur.localdomain>

Arthur Zakirov <a.zakirov@postgrespro.ru> writes:
> On Sun, Mar 25, 2018 at 12:18:10AM -0400, Tom Lane wrote:
>> My thought was (a) the ROLLBACK case is ok, because the next use of
>> the dictionary will reload it, and (b) the reload-concurrently-with-
>> DROP case is annoying, because indeed it leaks, but the window is small
>> and it probably won't be an issue in practice.  We would need to be
>> sure that the DSM segment goes away at postmaster restart, but given
>> that I think it'd be tolerable.  Of course it'd be better not to have
>> the race, but I see no easy way to prevent it -- do you?

> I'm not sure that I understood the second case correclty. Can cache
> invalidation help in this case? I don't have confident knowledge of cache
> invalidation. It seems to me that InvalidateTSCacheCallBack() should
> release segment after commit.

"Release after commit" sounds like a pretty dangerous design to me,
because a release necessarily implies some kernel calls, which could
fail.  We can't afford to inject steps that might fail into post-commit
cleanup (because it's too late to recover by failing the transaction).
It'd be better to do cleanup while searching for a dictionary to use.

I assume the DSM infrastructure already has some solution for getting
rid of DSM segments when the last interested process disconnects,
so maybe you could piggyback on that somehow.

			regards, tom lane




view thread (108+ messages)  latest in thread

Message-ID: <27296.1522078068@sss.pgh.pa.us>
Permalink:  ../27296.1522078068@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/27296.1522078068@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, a.zakirov@postgrespro.ru, tomas.vondra@2ndquadrant.com, pavel.stehule@gmail.com, andres@anarazel.de, i.kurbangaliev@postgrespro.ru
  Subject: Re: [PROPOSAL] Shared Ispell dictionaries
  In-Reply-To: <27296.1522078068@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox