Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: Zhihong Yu <zyu(at)yugabyte(dot)com>, Alexey Kondratov <a(dot)kondratov(at)postgrespro(dot)ru>, "Hou, Zhijie" <houzj(dot)fnst(at)cn(dot)fujitsu(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit
Date: 2021-01-15 01:32:53
Message-ID: de59a8ac-3297-c2ee-b8fb-a0f1f58b58cb@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2021/01/14 20:36, Bharath Rupireddy wrote:
> On Thu, Jan 14, 2021 at 3:52 PM Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> wrote:
>> - if (!HeapTupleIsValid(tup))
>> - elog(ERROR, "cache lookup failed for user mapping %u", entry->key);
>> - umform = (Form_pg_user_mapping) GETSTRUCT(tup);
>> - server = GetForeignServer(umform->umserver);
>> - ReleaseSysCache(tup);
>> + server = GetForeignServer(entry->serverid);
>>
>> What about applying only the change about serverid, as a separate patch at
>> first? This change itself is helpful to get rid of error "cache lookup failed"
>> in pgfdw_reject_incomplete_xact_state_change(). Patch attached.
>
> Right, we can get rid of the "cache lookup failed for user mapping"
> error and also storing server oid in the cache entry is helpful for
> the new functions we are going to introduce.
>
> serverid_v1.patch looks good to me. Both make check and make
> check-world passes on my system.

Thanks for the check! I pushed the patch.

> I will respond to other comments soon.

Thanks!

Regards,

--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-01-15 01:45:06 Re: pg_preadv() and pg_pwritev()
Previous Message Sergey Shinderuk 2021-01-15 01:12:01 Re: pg_preadv() and pg_pwritev()