Re: Support to define custom wait events for extensions

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Masahiro Ikeda <ikedamsh(at)oss(dot)nttdata(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:46:24
Message-ID: CAEudQAqxrrU-+mg2oxxmRe9YUWLpDbWT5+hNCJ8gfXCnK_ONjg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Em ter., 1 de ago. de 2023 às 21:34, Masahiro Ikeda <
ikedamsh(at)oss(dot)nttdata(dot)com> escreveu:

> 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
>
Yeah, removing wait_event_types.h works.

Thanks.

regards,
Ranier Vilela

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2023-08-02 00:50:14 Re: Use of additional index columns in rows filtering
Previous Message Masahiro Ikeda 2023-08-02 00:34:55 Re: Support to define custom wait events for extensions