Re: when the startup process doesn't

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Nitin Jadhav <nitinjadhavpostgres(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Stephen Frost <sfrost(at)snowman(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Magnus Hagander <magnus(at)hagander(dot)net>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: when the startup process doesn't
Date: 2021-06-06 22:23:05
Message-ID: 20210606222305.GZ14099@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jun 04, 2021 at 07:49:21PM +0530, Nitin Jadhav wrote:
> I have added the proper logs in all of the above scenarios.
>
> Following is the sample log displayed during server startup when the
> time period is set to 10ms.
>
> 2021-06-04 19:40:06.390 IST [51116] LOG: Syncing data directory, elapsed time: 14.165 ms, current path: ./base/13892/16384_fsm
> 2021-06-04 19:40:06.399 IST [51116] LOG: Syncing data directory completed after 22.661 ms

|2021-06-04 19:40:07.222 IST [51116] LOG: Performing crash recovery, elapsed time: 820.805 ms, current LSN: 0/76F6F10
|2021-06-04 19:40:07.227 IST [51116] LOG: invalid record length at 0/774E758: wanted 24, got 0
|2021-06-04 19:40:07.227 IST [51116] LOG: redo done at 0/774E730 system usage: CPU: user: 0.77 s, system: 0.03 s, elapsed: 0.82 s

Should it show the rusage ? It's shown at startup completion since 10a5b35a0,
so it seems strange not to show it here.

+ log_startup_process_progress("Syncing data directory", path, false);

I think the fsync vs syncfs paths should be distinguished: "Syncing data
directory (fsync)" vs "Syncing data directory (syncfs)".

+ {"log_min_duration_startup_process", PGC_SUSET, LOGGING_WHEN,

I think it should be PGC_SIGHUP, to allow changing it during runtime.
Obviously it has no effect except during startup, but the change will be
effective if the current process crashes.
See also: https://www.postgresql.org/message-id/20210526001359.GE3676@telsasoft.com

+extern void log_startup_process_progress(char *operation, void *data,
+ bool is_complete);

I think this should take an enum operation, rather than using strcmp() on it
later. The enum values might be RECOVERY_START, RECOVERY_END, rather than
having a bool is_complete.

--
Justin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message osumi.takamichi@fujitsu.com 2021-06-06 22:48:13 RE: locking [user] catalog tables vs 2pc vs logical rep
Previous Message Ranier Vilela 2021-06-06 21:34:53 Re: Move pg_attribute.attcompression to earlier in struct for reduced size?