RE: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit - Mailing list pgsql-hackers

From Hou, Zhijie
Subject RE: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit
Date
Msg-id fae6fb62365447638e4ae73169ab3766@G08CNEXMBPEKD05.g08.fujitsu.local
Whole thread Raw
In response to Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Responses Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
List pgsql-hackers
> Attaching v15 patch set. Please consider it for further review.

Hi

I have some comments for the 0001 patch

In v15-0001-postgres_fdw-function-to-discard-cached-connecti

1.
+      If there is no open connection to the given foreign server, <literal>false</literal>
+      is returned. If no foreign server with the given name is found, an error

Do you think it's better add some testcases about:
    call postgres_fdw_disconnect and postgres_fdw_disconnect_all when there is no open connection to the given foreign
server

2.
+            /*
+             * For the given server, if we closed connection or it is still in
+             * use, then no need of scanning the cache further.
+             */
+            if (entry->server_hashvalue == hashvalue &&
+                (entry->xact_depth > 0 || result))
+            {
+                hash_seq_term(&scan);
+                break;
+            }

If I am not wrong, is the following condition always true ?
    (entry->xact_depth > 0 || result)

Best regards,
houzj




pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Support for NSS as a libpq TLS backend
Next
From: Bharath Rupireddy
Date:
Subject: Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit