Re: Support to define custom wait events for extensions

From: Masahiro Ikeda <ikedamsh(at)oss(dot)nttdata(dot)com>
To: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Michael Paquier <michael(at)paquier(dot)xyz>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, tristan(at)neon(dot)tech, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: Support to define custom wait events for extensions
Date: 2023-08-02 00:34:55
Message-ID: b9efe7f1695cceb9d1d4b1ea506a3b55@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2023-08-02 08:38, Ranier Vilela wrote:
> Hi,
>
> On Tue, Aug 01, 2023 at 11:51:35AM +0900, Masahiro Ikeda wrote:
>> Thanks for committing the main patch.
>
> Latest head
> Ubuntu 64 bits
> gcc 13 64 bits
>
> ./configure --without-icu
> make clean
>
> make
>
> In file included from ../../src/include/pgstat.h:20,
> from controldata_utils.c:38:
> ../../src/include/utils/wait_event.h:56:9: error: redeclaration of
> enumerator ‘WAIT_EVENT_EXTENSION’
> 56 | WAIT_EVENT_EXTENSION = PG_WAIT_EXTENSION,
> | ^~~~~~~~~~~~~~~~~~~~
> In file included from ../../src/include/utils/wait_event.h:29,
> from ../../src/include/pgstat.h:20,
> from controldata_utils.c:38:
> ../../src/include/utils/wait_event_types.h:60:9: note: previous
> definition of ‘WAIT_EVENT_EXTENSION’ with type ‘enum
> <anonymous>’
> 60 | WAIT_EVENT_EXTENSION = PG_WAIT_EXTENSION
> | ^~~~~~~~~~~~~~~~~~~~
> In file included from ../../src/include/pgstat.h:20,
> from controldata_utils.c:38:
> ../../src/include/utils/wait_event.h:58:3: error: conflicting types
> for ‘WaitEventExtension’; have ‘enum <anonymous>’
> 58 | } WaitEventExtension;
> | ^~~~~~~~~~~~~~~~~~
> In file included from ../../src/include/utils/wait_event.h:29,
> from ../../src/include/pgstat.h:20,
> from controldata_utils.c:38:
> ../../src/include/utils/wait_event_types.h:61:3: note: previous
> declaration of ‘WaitEventExtension’ with type
> ‘WaitEventExtension’
> 61 | } WaitEventExtension;
> | ^~~~~~~~~~~~~~~~~~
> make[2]: *** [Makefile:174: controldata_utils_srv.o] Erro 1
> make[2]: Saindo do diretório '/usr/src/postgres_commits/src/common'
> make[1]: *** [Makefile:42: all-common-recurse] Erro 2
> make[1]: Saindo do diretório '/usr/src/postgres_commits/src'
> make: *** [GNUmakefile:11: all-src-recurse] Erro 2
> ranier(at)notebook2:/usr/src/postgres_commits$ grep -r --include '*.c'
> "WAIT_EVENT_EXTESION" .
> ranier(at)notebook2:/usr/src/postgres_commits$ grep -r --include '*.c'
> "WAIT_EVENT_EXTENSION" .
>
> grep -r --include '*.h' "WAIT_EVENT_EXTENSION" .
> ./src/backend/utils/activity/wait_event_types.h: WAIT_EVENT_EXTENSION
> = PG_WAIT_EXTENSION
> ./src/include/utils/wait_event.h: WAIT_EVENT_EXTENSION =
> PG_WAIT_EXTENSION,
> ./src/include/utils/wait_event.h:
> WAIT_EVENT_EXTENSION_FIRST_USER_DEFINED
>
> Not sure if this is really a mistake in my environment.

I can build without error.
* latest commit(3845577cb55eab3e06b3724e307ebbcac31f4841)
* gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)

The result in my environment is
$ grep -r --include '*.h' "WAIT_EVENT_EXTENSION" .
./src/include/utils/wait_event.h: WAIT_EVENT_EXTENSION =
PG_WAIT_EXTENSION,
./src/include/utils/wait_event.h:
WAIT_EVENT_EXTENSION_FIRST_USER_DEFINED

I think the error occurred because the old wait_event_types.h still
exists.
Can you remove it before building and try again?

$ make maintainer-clean # remove wait_event_types.h
$ ./configure --without-icu
$ make

Regards,
--
Masahiro Ikeda
NTT DATA CORPORATION

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ranier Vilela 2023-08-02 00:46:24 Re: Support to define custom wait events for extensions
Previous Message David Rowley 2023-08-02 00:25:35 Re: Performance degradation on concurrent COPY into a single relation in PG16.