Re: add recovery, backup, archive, streaming etc. activity messages to server logs along with ps display

From: "Euler Taveira" <euler(at)eulerto(dot)com>
To: "Bharath Rupireddy" <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, "Bossart, Nathan" <bossartn(at)amazon(dot)com>
Cc: "PostgreSQL Hackers" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "Alvaro Herrera" <alvherre(at)alvh(dot)no-ip(dot)org>
Subject: Re: add recovery, backup, archive, streaming etc. activity messages to server logs along with ps display
Date: 2021-11-11 15:46:47
Message-ID: 6e1625c2-ad82-4dad-8ccf-01d8a7dbb0d3@www.fastmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
EDB https://www.enterprisedb.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bossart, Nathan 2021-11-11 16:04:02 Re: Improving psql's \password command
Previous Message Bossart, Nathan 2021-11-11 15:37:12 Re: .ready and .done files considered harmful