Re: Consistently use the XLogRecPtrIsInvalid() macro

Поиск
Список
Период
Сортировка
От Bertrand Drouvot
Тема Re: Consistently use the XLogRecPtrIsInvalid() macro
Дата
Msg-id aRXm/KnHlXAThWNf@ip-10-97-1-34.eu-west-3.compute.internal
обсуждение исходный текст
Ответ на Re: Consistently use the XLogRecPtrIsInvalid() macro  (Álvaro Herrera <alvherre@kurilemu.de>)
Список pgsql-hackers
On Fri, Nov 07, 2025 at 02:37:32PM +0100, Álvaro Herrera wrote:

> Hmm, I tried to recreate your patch using this .cocci file, and in my
> run, there's a few changes in your patch that my spatch run didn't
> detect.  I wonder if that's because my spatch version is buggy, or
> because you hacked the .cocci file beyond what's in your github repo.

spatch needs to be run with --recursive-includes (so that the .cocci script
is able to collect information from all the structs of interest). The header
comment in the .cocci script did not mention that: just fixed).

But then I realized that if I run spatch that way:

spatch --sp-file replace_literal_0_assignement_with_InvalidXLogRecPtr.cocci \
      --dir /path/to/postgres/src \
      -I /path/to/postgres/src/include \
      --recursive-includes \
      > replace.patch

Then some headers were not included (no clue as to why). But if I run spatch on
the .c files one by one with the --recursive-includes then it works (i.e all
the headers of interest are included).

So, I created [1] to run spatch one by one on all the .c files (in parallel).

To produce the patch that I shared I ran:

./run_parallel.sh /absolute_path_to/replace_literal_0_assignement_with_InvalidXLogRecPtr.cocci -j 32

(patch can be found in /path/to/postgres once completed).

> (I'm wondering if I should reproduce your previous patches in case there
> were also differences there.  Life is short though.)

I guess/hope you'll get the same results if you use run_parallel.sh as mentioned
above.

[1]: https://github.com/bdrouvot/coccinelle_on_pg/blob/main/wrappers/run_parallel.sh

Regards,

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



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