Re: postgres_fdw - make cached connection functions tests meaningful

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: postgres_fdw - make cached connection functions tests meaningful
Date: 2021-07-17 16:06:59
Message-ID: 70649.1626538019@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> writes:
> On Thu, Jul 15, 2021 at 3:48 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> More generally, though, I am not sure that I believe the premise of
>> this patch. AFAICS it's assuming that forcing debug_discard_caches
>> off guarantees zero cache flushes, which it does not.

> Can the setting debug_discard_caches = 0 still make extra
> flushes/discards (not the regular cache flushes/discards that happen
> because of alters or changes in the cached elements)? My understanding
> was that debug_discard_caches = 0, disables all the extra flushes with
> clobber cache builds. If my understanding wasn't right, isn't it good
> to mention it somewhere in the documentation or in the source code?

The reason for this mechanism is that cache flushes can be triggered
at any time by sinval messages from other processes (e.g., background
autovacuums). Setting debug_discard_caches allows us to exercise
that possibility exhaustively and make sure that the code is proof
against cache entries disappearing unexpectedly. Not setting
debug_discard_caches doesn't mean that that can't happen, only that
you can't predict when it will happen.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Soumyadeep Chakraborty 2021-07-17 18:57:39 Re: A micro-optimisation for ProcSendSignal()
Previous Message Tom Lane 2021-07-17 15:57:00 Re: What are exactly bootstrap processes, auxiliary processes, standalone backends, normal backends(user sessions)?