Re: Use XLOG_CONTROL_FILE macro everywhere?

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: a(dot)melnikov(at)postgrespro(dot)ru
Cc: daniel(at)yesql(dot)se, peter(at)eisentraut(dot)org, tgl(at)sss(dot)pgh(dot)pa(dot)us, robertmhaas(at)gmail(dot)com, michael(at)paquier(dot)xyz, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Use XLOG_CONTROL_FILE macro everywhere?
Date: 2024-09-04 08:09:27
Message-ID: 20240904.170927.1051663922860738119.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Tue, 3 Sep 2024 12:02:26 +0300, "Anton A. Melnikov" <a(dot)melnikov(at)postgrespro(dot)ru> wrote in
> In v2 removed XLOG_CONTROL_FILE from args and used it directly in the
> string.
> IMHO this makes the code more readable and will output the correct
> text if the macro changes.

Yeah, I had this in my mind. Looks good to me.

> 3)
..
> Maybe include/access/xlogdefs.h would be a good place for this?
> In v2 moved some definitions from xlog_internal to xlogdefs
> and removed including xlog_internal.h from the postmaster.c.
> Please, take a look on it.

The change can help avoid disrupting existing users of the
macro. However, the file is documented as follows:

> * Postgres write-ahead log manager record pointer and
> * timeline number definitions

We could modify the file definition, but I'm not sure if that's the
best approach. Instead, I'd like to propose separating the file and
path-related definitions from xlog_internal.h, as shown in the
attached first patch. This change would allow some modules to include
files without unnecessary details.

The second file is your patch, adjusted based on the first patch.

I’d appreciate hearing from others on whether they find the first
patch worthwhile. If it’s not considered worthwhile, then I believe
having postmaster include xlog_internal.h would be the best approach.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
0001-Split-file-related-parts-from-xlog_internal.h.patch text/x-patch 20.9 KB
0002-Use-XLOG_CONTROL_FILE-macro-everywhere-in-C-code.patch text/x-patch 8.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2024-09-04 08:23:44 Re: Typos in the code and README
Previous Message Dean Rasheed 2024-09-04 07:22:40 Re: Optimize mul_var() for var1ndigits >= 8