Re: Remove Start* macros from postmaster.c to ease understanding of code

Поиск
Список
Период
Сортировка
От Bharath Rupireddy
Тема Re: Remove Start* macros from postmaster.c to ease understanding of code
Дата
Msg-id CALj2ACVeAB3LN58Q8R8sCjaFhT3WdStdSLyomupAnHY3QpMV+Q@mail.gmail.com
обсуждение исходный текст
Ответ на Remove Start* macros from postmaster.c to ease understanding of code  (reid.thompson@crunchydata.com)
Ответы Re: Remove Start* macros from postmaster.c to ease understanding of code  (Nathan Bossart <nathandbossart@gmail.com>)
Список pgsql-hackers
On Tue, Feb 6, 2024 at 10:34 PM <reid.thompson@crunchydata.com> wrote:
>
> Hi,
>
> Attached is a small patch implemented as I agree with Andres' comment
> below noted while reviewing the thread
>
https://www.postgresql.org/message-id/flat/20240122210740.7vq5fd4woixpwx3f%40awork3.anarazel.de#6eb7595873392621d60e6b5a723941bc
>
> I agree that its easier to not have to refer back to the macros only to
> see that they're all invoking StartChildProcess(X). All invocations are
> within postmaster.c.
>
> > @@ -561,13 +561,13 @@ static void ShmemBackendArrayAdd(Backend *bn);
> >  static void ShmemBackendArrayRemove(Backend *bn);
> >  #endif                                                       /* EXEC_BACKEND */
> >
> > -#define StartupDataBase()            StartChildProcess(StartupProcess)
> > -#define StartArchiver()                      StartChildProcess(ArchiverProcess)
> > -#define StartBackgroundWriter() StartChildProcess(BgWriterProcess)
> > -#define StartCheckpointer()          StartChildProcess(CheckpointerProcess)
> > -#define StartWalWriter()             StartChildProcess(WalWriterProcess)
> > -#define StartWalReceiver()           StartChildProcess(WalReceiverProcess)
> > -#define StartWalSummarizer() StartChildProcess(WalSummarizerProcess)
> > +#define StartupDataBase()            StartChildProcess(B_STARTUP)
> > +#define StartArchiver()                      StartChildProcess(B_ARCHIVER)
> > +#define StartBackgroundWriter() StartChildProcess(B_BG_WRITER)
> > +#define StartCheckpointer()          StartChildProcess(B_CHECKPOINTER)
> > +#define StartWalWriter()             StartChildProcess(B_WAL_WRITER)
> > +#define StartWalReceiver()           StartChildProcess(B_WAL_RECEIVER)
> > +#define StartWalSummarizer() StartChildProcess(B_WAL_SUMMARIZER)
>
> Not for this commit, but we ought to rip out these macros - all they do is to make it harder to understand the code.

+1. Patch LGTM.

--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Erik Wienhold
Дата:
Сообщение: Re: Psql meta-command conninfo+
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Why is subscription/t/031_column_list.pl failing so much?