RE: Add client connection check during the execution of the query

From: "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>
To: 'Thomas Munro' <thomas(dot)munro(at)gmail(dot)com>
Cc: Maksim Milyutin <milyutinma(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>, Zhihong Yu <zyu(at)yugabyte(dot)com>
Subject: RE: Add client connection check during the execution of the query
Date: 2021-04-02 05:18:40
Message-ID: TYAPR01MB2990E5F57212DBFD41F61983FE7A9@TYAPR01MB2990.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
> > Following PostmasterIsAlive(), maybe it's better to name it as
> pq_connection_is_alive() pq_client_is_alive(), or pq_frontend_is_alive() like
> the pqcomm.c's head comment uses the word frontend?
>
> I think it's OK, because it matches the name of the GUC. I'm more concerned
> about the name of the GUC. Will we still be happy with this name if a future
> releases sends a heartbeat message? I think that is still OK, so I'm happy with
> these names for now, but if someone has a better name, please speak up very
> soon.

OK, agreed.

> > (4)
> > I think the new GUC works for walsender as well. If so, how do we explain
> the relationship between the new GUC and wal_receiver_timeout and
> recommend the settings of them?
>
> No, it only works while executing a query. (Is there something in logical
> decoding, perhaps, that I have failed to consider?)

When I saw the following code, I thought the new GUC takes effect at the same time as wal\sender_timeout. But they don't become effective simultaneously. The new GUC is effective before the logical replication starts. And wal_sender_timeout takes effect after the physical/logical replication starts. So, there's no problem.

[PostgresMain]
if (am_walsender)
{
if (!exec_replication_command(query_string))
exec_simple_query(query_string);
}
else
exec_simple_query(query_string);

The patch looks committable to me.

> PS The "from" headers in emails received from Fujitsu seems to have the
> names stripped, somewhere in the tubes of the internet. I see the full version
> when people from Fujitsu quote other people from Fujitsu.
> I copied one of those into the commit message, complete with its magnificent
> kanji characters (perhaps these are the cause of the filtering?), and I hope
> that's OK with you.

Certainly, it seems that only my email address appears in the sender field on the mailer. I'll check my Outlook settings.

Regards
Takayuki Tsunakawa

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Shinya11.Kato 2021-04-02 05:23:32 Fix pg_checksums progress report
Previous Message Bryn Llewellyn 2021-04-02 04:46:58 Have I found an interval arithmetic bug?