RE: postgres_fdw - cached connection leaks if the associated user mapping/foreign server is dropped

Поиск
Список
Период
Сортировка
От Hou, Zhijie
Тема RE: postgres_fdw - cached connection leaks if the associated user mapping/foreign server is dropped
Дата
Msg-id 55945fb1abb74c08bea59cbb7f8b427a@G08CNEXMBPEKD05.g08.fujitsu.local
обсуждение исходный текст
Ответ на Re: postgres_fdw - cached connection leaks if the associated user mapping/foreign server is dropped  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Список pgsql-hackers
Hi

I have an issue about the existing testcase.

"""
-- Test that alteration of server options causes reconnection SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1;  --
shouldwork ALTER SERVER loopback OPTIONS (SET dbname 'no such database'); SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT
1; -- should fail DO $d$
 
    BEGIN
        EXECUTE $$ALTER SERVER loopback
            OPTIONS (SET dbname '$$||current_database()||$$')$$;
    END;
$d$;
SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1;  -- should work again """

IMO, the above case is designed to test the following code[1]:
With the patch, it seems the following code[1] will not work for this case, right?
(It seems the connection will be disconnect in pgfdw_xact_callback)

I do not know does it matter, or should we add a testcase to cover that?

[1]    /*
     * If the connection needs to be remade due to invalidation, disconnect as
     * soon as we're out of all transactions.
     */
    if (entry->conn != NULL && entry->invalidated && entry->xact_depth == 0)
    {
        elog(DEBUG3, "closing connection %p for option changes to take effect",
             entry->conn);
        disconnect_pg_server(entry);
    }


Best regards,
houzj



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Incorrect allocation handling for cryptohash functions with OpenSSL
Следующее
От: Laurenz Albe
Дата:
Сообщение: Re: allow to \dtS+ pg_toast.*