Re: add recovery, backup, archive, streaming etc. activity messages to server logs along with ps display - Mailing list pgsql-hackers

From Euler Taveira
Subject Re: add recovery, backup, archive, streaming etc. activity messages to server logs along with ps display
Date
Msg-id 6e1625c2-ad82-4dad-8ccf-01d8a7dbb0d3@www.fastmail.com
Whole thread Raw
In response to Re: add recovery, backup, archive, streaming etc. activity messages to server logs along with ps display  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
List pgsql-hackers
On Thu, Nov 11, 2021, at 2:50 AM, Bharath Rupireddy wrote:
But for the snprintf(activitymsg, sizeof(activitymsg), "archiving %s",
xlog); we have elog(DEBUG1, "archived write-ahead log file \"%s\"",
xlog); after the archiving command. It is also good to have a similar
debug message before archive command execution, we can get to know
whether archive command is executed or not, if yes how much time did
it take etc.?
If you are only interested in how much time it took to archive a WAL file, you
don't need 2 messages (before and after); one message is sufficient. If you
calculate the difference and then print it as part of the existent message.
Calculate the difference iif the log level is at least DEBUG1 (same as the log
message).

Messages related to system() e.g. archive and recovery, you could measure the
execution time in your own script/program.

I like Alvaro's idea of implementing a ring buffer for this kind of activity.
This implementation could be applied to checkpoints, archiving, recovery,
replication, base backup, WAL usage, connections and others.


--
Euler Taveira

pgsql-hackers by date:

Previous
From: "Bossart, Nathan"
Date:
Subject: Re: .ready and .done files considered harmful
Next
From: "Bossart, Nathan"
Date:
Subject: Re: Improving psql's \password command