Re: Should we improve "PID XXXX is not a PostgreSQL server process" warning for pg_terminate_backend(<<postmaster_pid>>)?

Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>

From: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
To: torikoshia <torikoshia@oss.nttdata.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-03-17T09:14:21Z
Lists: pgsql-hackers

Attachments

On Wed, Mar 17, 2021 at 8:05 AM torikoshia <torikoshia@oss.nttdata.com> wrote:
> > I have not gone through that thread though. Is there any way we can
> > detect those child processes(stats collector, sys logger) that are
> > forked by the postmaster from a backend process? Thoughts?
>
> I couldn't find good ways to do that, and thus I'm now wondering
> just changing the message.

Changed the message.

> >> I'm now wondering if changing the message to something like
> >> "PID XXXX is not a PostgreSQL backend process".
> >>
> >> "backend process' is now defined as "Process of an instance
> >> which acts on behalf of a client session and handles its
> >> requests." in Appendix.
> >
> > Yeah, that looks good to me. IIUC, we can just change the message from
> > "PID XXXX is not a PostgreSQL server process" to "PID XXXX is not a
> > PostgreSQL backend process" and we don't need look for AuxiliaryProcs
> > or PostmasterPid.
>
> Changing log messages can affect operations, especially when people
> monitor the log message strings, but improving "PID XXXX is not a
> PostgreSQL server process" does not seem to cause such problems.

Now the error message clearly says that the given pid not a backend
process. Attaching v2 patch. Please have a look.

With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com

Commits

  1. Improve warning message in pg_signal_backend()