Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rU9in-009Bvr-RP for pgsql-hackers@arkaria.postgresql.org; Sun, 28 Jan 2024 18:17:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rU9ik-009bKi-Bw for pgsql-hackers@arkaria.postgresql.org; Sun, 28 Jan 2024 18:17:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rU9ij-009bKZ-Qj for pgsql-hackers@lists.postgresql.org; Sun, 28 Jan 2024 18:17:30 +0000 Received: from forwardcorp1b.mail.yandex.net ([2a02:6b8:c02:900:1:45:d181:df01]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rU9ic-004C1e-Fa for pgsql-hackers@postgresql.org; Sun, 28 Jan 2024 18:17:28 +0000 Received: from mail-nwsmtp-smtp-corp-main-62.myt.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-62.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:579c:0:640:90b3:0]) by forwardcorp1b.mail.yandex.net (Yandex) with ESMTPS id 354D460C9B; Sun, 28 Jan 2024 21:17:20 +0300 (MSK) Received: from smtpclient.apple (unknown [2a02:6b8:b081:6528::1:25]) by mail-nwsmtp-smtp-corp-main-62.myt.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id HHcfan0IaiE0-uUkIr1nO; Sun, 28 Jan 2024 21:17:19 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1706465839; bh=FCHhQO6iOLPjqxGi1twPNU5GTT9J846zHgX49071j3I=; h=References:To:Cc:In-Reply-To:From:Date:Subject:Message-Id; b=Y1V2UMTypL+EOz7kn0pwfzIM2WJ495UIdLeepJ6QUi6Zrrf1I7DgcASOZ/I3UN5zL UKicEklVcKJAfZIdiVN1wugscfDg74Flgd9qcOufFg0OpSDV/WLcwC+NUJ9haVC/CX qbEPF01ir0x1YRynnHmLQSx3FtDc0DQu3k42k43U= Authentication-Results: mail-nwsmtp-smtp-corp-main-62.myt.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: "Andrey M. Borodin" Message-Id: Content-Type: multipart/mixed; boundary="Apple-Mail=_FB47BAD3-5268-4810-80AD-58FECD1A5ED7" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.4\)) Subject: Re: MultiXact\SLRU buffers configuration Date: Sun, 28 Jan 2024 23:17:16 +0500 In-Reply-To: <202401281249.u6ham26mbjav@alvherre.pgsql> Cc: vignesh C , Andrew Borodin , i.lazarev@postgrespro.ru, Yura Sokolov , Andres Freund , Thomas Munro , Gilles Darold , Tomas Vondra , Tomas Vondra , Alexander Korotkov , Anastasia Lubennikova , Daniel Gustafsson , Kyotaro Horiguchi , pgsql-hackers mailing list To: Alvaro Herrera References: <202401281249.u6ham26mbjav@alvherre.pgsql> X-Mailer: Apple Mail (2.3696.120.41.1.4) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_FB47BAD3-5268-4810-80AD-58FECD1A5ED7 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On 28 Jan 2024, at 17:49, Alvaro Herrera = wrote: >=20 > I'd appreciate it if you or Horiguchi-san can update his patch to = remove > use of usleep in favor of a CV in multixact, and keep this CF entry to > cover it. Sure! Sounds great! > Perhaps a test to make the code reach the usleep(1000) can be written > using injection points (49cd2b93d7db)? I've tried to prototype something like that. But interesting point = between GetNewMultiXactId() and RecordNewMultiXact() is a critical = section, and we cannot have injection points in critical sections... Also, to implement such a test we need "wait" type of injection points, = see step 2 in attachment. With this type of injection points I can stop = a backend amidst entering information about new MultiXact. Best regards, Andrey Borodin. --Apple-Mail=_FB47BAD3-5268-4810-80AD-58FECD1A5ED7 Content-Disposition: attachment; filename=0001-Add-conditional-variable-to-wait-for-next-MultXact-o.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Add-conditional-variable-to-wait-for-next-MultXact-o.patch" Content-Transfer-Encoding: quoted-printable =46rom=20975eb3448acbec97c14d48f21261e44aca7b3acc=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Andrey=20Borodin=20=0ADate:=20= Fri,=2022=20May=202020=2014:13:33=20+0500=0ASubject:=20[PATCH=201/3]=20= Add=20conditional=20variable=20to=20wait=20for=20next=20MultXact=20= offset=0A=20in=20edge=20case=0A=0A---=0A=20= src/backend/access/transam/multixact.c=20=20=20=20=20=20=20=20|=2023=20= ++++++++++++++++++-=0A=20.../utils/activity/wait_event_names.txt=20=20=20= =20=20=20=20|=20=201=20+=0A=202=20files=20changed,=2023=20insertions(+),=20= 1=20deletion(-)=0A=0Adiff=20--git=20= a/src/backend/access/transam/multixact.c=20= b/src/backend/access/transam/multixact.c=0Aindex=20= 59523be901..03fcd25d4c=20100644=0A---=20= a/src/backend/access/transam/multixact.c=0A+++=20= b/src/backend/access/transam/multixact.c=0A@@=20-82,6=20+82,7=20@@=0A=20= #include=20"lib/ilist.h"=0A=20#include=20"miscadmin.h"=0A=20#include=20= "pg_trace.h"=0A+#include=20"pgstat.h"=0A=20#include=20= "postmaster/autovacuum.h"=0A=20#include=20"storage/lmgr.h"=0A=20#include=20= "storage/pmsignal.h"=0A@@=20-233,6=20+234,7=20@@=20typedef=20struct=20= MultiXactStateData=0A=20=09/*=20support=20for=20members=20= anti-wraparound=20measures=20*/=0A=20=09MultiXactOffset=20= offsetStopLimit;=09/*=20known=20if=20oldestOffsetKnown=20*/=0A=20=0A+=09= ConditionVariable=20nextoff_cv;=0A=20=09/*=0A=20=09=20*=20Per-backend=20= data=20starts=20here.=20=20We=20have=20two=20arrays=20stored=20in=20the=20= area=0A=20=09=20*=20immediately=20following=20the=20MultiXactStateData=20= struct.=20Each=20is=20indexed=20by=0A@@=20-894,6=20+896,14=20@@=20= RecordNewMultiXact(MultiXactId=20multi,=20MultiXactOffset=20offset,=0A=20= =09/*=20Exchange=20our=20lock=20*/=0A=20=09= LWLockRelease(MultiXactOffsetSLRULock);=0A=20=0A+=09/*=0A+=09=20*=20=20= Let=20everybody=20know=20the=20offset=20of=20this=20mxid=20is=20recorded=20= now.=20The=20waiters=0A+=09=20*=20=20are=20waiting=20for=20the=20offset=20= of=20the=20mxid=20next=20of=20the=20target=20to=20know=20the=0A+=09=20*=20= =20number=20of=20members=20of=20the=20target=20mxid,=20so=20we=20don't=20= need=20to=20wait=20for=0A+=09=20*=20=20members=20of=20this=20mxid=20are=20= recorded.=0A+=09=20*/=0A+=09= ConditionVariableBroadcast(&MultiXactState->nextoff_cv);=0A+=0A=20=09= LWLockAcquire(MultiXactMemberSLRULock,=20LW_EXCLUSIVE);=0A=20=0A=20=09= prev_pageno=20=3D=20-1;=0A@@=20-1388,9=20+1398,19=20@@=20retry:=0A=20=09=09= if=20(nextMXOffset=20=3D=3D=200)=0A=20=09=09{=0A=20=09=09=09/*=20Corner=20= case=202:=20next=20multixact=20is=20still=20being=20filled=20in=20*/=0A+=0A= +=09=09=09/*=0A+=09=09=09=20*=20The=20recorder=20of=20the=20next=20mxid=20= is=20just=20before=20writing=20the=20offset.=0A+=09=09=09=20*=20Wait=20= for=20the=20offset=20to=20be=20written.=0A+=09=09=09=20*/=0A+=09=09=09= ConditionVariablePrepareToSleep(&MultiXactState->nextoff_cv);=0A+=0A=20=09= =09=09LWLockRelease(MultiXactOffsetSLRULock);=0A=20=09=09=09= CHECK_FOR_INTERRUPTS();=0A-=09=09=09pg_usleep(1000L);=0A+=0A+=09=09=09= ConditionVariableSleep(&MultiXactState->nextoff_cv,=0A+=09=09=09=09=09=09= =09=09=20=20=20WAIT_EVENT_NEXT_MXMEMBERS);=0A+=09=09=09= ConditionVariableCancelSleep();=0A=20=09=09=09goto=20retry;=0A=20=09=09}=0A= =20=0A@@=20-1875,6=20+1895,7=20@@=20MultiXactShmemInit(void)=0A=20=0A=20=09= =09/*=20Make=20sure=20we=20zero=20out=20the=20per-backend=20state=20*/=0A= =20=09=09MemSet(MultiXactState,=200,=20SHARED_MULTIXACT_STATE_SIZE);=0A+=09= =09ConditionVariableInit(&MultiXactState->nextoff_cv);=0A=20=09}=0A=20=09= else=0A=20=09=09Assert(found);=0Adiff=20--git=20= a/src/backend/utils/activity/wait_event_names.txt=20= b/src/backend/utils/activity/wait_event_names.txt=0Aindex=20= a5df835dd4..1bb78d5aad=20100644=0A---=20= a/src/backend/utils/activity/wait_event_names.txt=0A+++=20= b/src/backend/utils/activity/wait_event_names.txt=0A@@=20-144,6=20+144,7=20= @@=20SYNC_REP=09"Waiting=20for=20confirmation=20from=20a=20remote=20= server=20during=20synchronous=20repli=0A=20WAL_RECEIVER_EXIT=09"Waiting=20= for=20the=20WAL=20receiver=20to=20exit."=0A=20WAL_RECEIVER_WAIT_START=09= "Waiting=20for=20startup=20process=20to=20send=20initial=20data=20for=20= streaming=20replication."=0A=20WAL_SUMMARY_READY=09"Waiting=20for=20a=20= new=20WAL=20summary=20to=20be=20generated."=0A+NEXT_MXMEMBERS=09"Waiting=20= for=20a=20next=20multixact=20member=20to=20be=20filled."=0A=20= XACT_GROUP_UPDATE=09"Waiting=20for=20the=20group=20leader=20to=20update=20= transaction=20status=20at=20end=20of=20a=20parallel=20operation."=0A=20=0A= =20=0A--=20=0A2.37.1=20(Apple=20Git-137.1)=0A=0A= --Apple-Mail=_FB47BAD3-5268-4810-80AD-58FECD1A5ED7 Content-Disposition: attachment; filename=0002-Add-wait-type-for-injection-points.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0002-Add-wait-type-for-injection-points.patch" Content-Transfer-Encoding: quoted-printable =46rom=2093b4c7dac290d6d2d212522b1a10fef03372315e=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20"Andrey=20M.=20Borodin"=20=0A= Date:=20Sun,=2028=20Jan=202024=2022:22:22=20+0500=0ASubject:=20[PATCH=20= 2/3]=20Add=20wait=20type=20for=20injection=20points=0A=0A---=0A=20= src/backend/utils/misc/injection_point.c=20=20=20=20=20=20|=2020=20= +++++++++++++++++++=0A=20src/include/utils/injection_point.h=20=20=20=20=20= =20=20=20=20=20=20|=20=201=20+=0A=20= src/test/modules/injection_points/Makefile=20=20=20=20|=20=201=20+=0A=20= .../injection_points/injection_points.c=20=20=20=20=20=20=20|=2016=20= +++++++++++++++=0A=204=20files=20changed,=2038=20insertions(+)=0A=0Adiff=20= --git=20a/src/backend/utils/misc/injection_point.c=20= b/src/backend/utils/misc/injection_point.c=0Aindex=20= 0cf4d51cac..398ef2cf30=20100644=0A---=20= a/src/backend/utils/misc/injection_point.c=0A+++=20= b/src/backend/utils/misc/injection_point.c=0A@@=20-252,6=20+252,26=20@@=20= InjectionPointDetach(const=20char=20*name)=0A=20#endif=0A=20}=0A=20=0A= +/*=0A+=20*=20Test=20if=20injection=20point=20is=20attached.=0A+=20*/=0A= +bool=0A+InjectionPointIsAttach(const=20char=20*name)=0A+{=0A+#ifdef=20= USE_INJECTION_POINTS=0A+=09bool=09=09found;=0A+=0A+=09= LWLockAcquire(InjectionPointLock,=20LW_EXCLUSIVE);=0A+=09= hash_search(InjectionPointHash,=20name,=20HASH_FIND,=20&found);=0A+=09= LWLockRelease(InjectionPointLock);=0A+=0A+=09return=20found;=0A+=0A= +#else=0A+=09elog(ERROR,=20"Injection=20points=20are=20not=20supported=20= by=20this=20build");=0A+#endif=0A+}=0A+=0A=20/*=0A=20=20*=20Execute=20an=20= injection=20point,=20if=20defined.=0A=20=20*=0Adiff=20--git=20= a/src/include/utils/injection_point.h=20= b/src/include/utils/injection_point.h=0Aindex=2055524b568f..e07f6b7024=20= 100644=0A---=20a/src/include/utils/injection_point.h=0A+++=20= b/src/include/utils/injection_point.h=0A@@=20-33,5=20+33,6=20@@=20extern=20= void=20InjectionPointAttach(const=20char=20*name,=0A=20=09=09=09=09=09=09= =09=09=20const=20char=20*function);=0A=20extern=20void=20= InjectionPointRun(const=20char=20*name);=0A=20extern=20void=20= InjectionPointDetach(const=20char=20*name);=0A+extern=20bool=20= InjectionPointIsAttach(const=20char=20*name);=0A=20=0A=20#endif=09=09=09=09= =09=09=09/*=20INJECTION_POINT_H=20*/=0Adiff=20--git=20= a/src/test/modules/injection_points/Makefile=20= b/src/test/modules/injection_points/Makefile=0Aindex=20= 2cbbae4e0a..543d2ab927=20100644=0A---=20= a/src/test/modules/injection_points/Makefile=0A+++=20= b/src/test/modules/injection_points/Makefile=0A@@=20-7,6=20+7,7=20@@=20= DATA=20=3D=20injection_points--1.0.sql=0A=20PGFILEDESC=20=3D=20= "injection_points=20-=20facility=20for=20injection=20points"=0A=20=0A=20= REGRESS=20=3D=20injection_points=0A+TAP_TESTS=20=3D=201=0A=20=0A=20ifdef=20= USE_PGXS=0A=20PG_CONFIG=20=3D=20pg_config=0Adiff=20--git=20= a/src/test/modules/injection_points/injection_points.c=20= b/src/test/modules/injection_points/injection_points.c=0Aindex=20= e843e6594f..fbb30b15ad=20100644=0A---=20= a/src/test/modules/injection_points/injection_points.c=0A+++=20= b/src/test/modules/injection_points/injection_points.c=0A@@=20-18,6=20= +18,7=20@@=0A=20#include=20"postgres.h"=0A=20=0A=20#include=20"fmgr.h"=0A= +#include=20"miscadmin.h"=0A=20#include=20"storage/lwlock.h"=0A=20= #include=20"storage/shmem.h"=0A=20#include=20"utils/builtins.h"=0A@@=20= -28,6=20+29,7=20@@=20PG_MODULE_MAGIC;=0A=20=0A=20extern=20PGDLLEXPORT=20= void=20injection_error(const=20char=20*name);=0A=20extern=20PGDLLEXPORT=20= void=20injection_notice(const=20char=20*name);=0A+extern=20PGDLLEXPORT=20= void=20injection_wait(const=20char=20*name);=0A=20=0A=20=0A=20/*=20Set=20= of=20callbacks=20available=20to=20be=20attached=20to=20an=20injection=20= point.=20*/=0A@@=20-43,6=20+45,18=20@@=20injection_notice(const=20char=20= *name)=0A=20=09elog(NOTICE,=20"notice=20triggered=20for=20injection=20= point=20%s",=20name);=0A=20}=0A=20=0A+void=0A+injection_wait(const=20= char=20*name)=0A+{=0A+=09elog(NOTICE,=20"waiting=20triggered=20for=20= injection=20point=20%s",=20name);=0A+=09do=0A+=09{=0A+=09=09= CHECK_FOR_INTERRUPTS();=0A+=09=09pg_usleep(1000L);=0A+=09}=20while=20= (InjectionPointIsAttach(name));=0A+=09elog(NOTICE,=20"waiting=20done=20= for=20injection=20point=20%s",=20name);=0A+}=0A+=0A=20/*=0A=20=20*=20SQL=20= function=20for=20creating=20an=20injection=20point.=0A=20=20*/=0A@@=20= -58,6=20+72,8=20@@=20injection_points_attach(PG_FUNCTION_ARGS)=0A=20=09=09= function=20=3D=20"injection_error";=0A=20=09else=20if=20(strcmp(action,=20= "notice")=20=3D=3D=200)=0A=20=09=09function=20=3D=20"injection_notice";=0A= +=09else=20if=20(strcmp(action,=20"wait")=20=3D=3D=200)=0A+=09=09= function=20=3D=20"injection_wait";=0A=20=09else=0A=20=09=09elog(ERROR,=20= "incorrect=20action=20\"%s\"=20for=20injection=20point=20creation",=20= action);=0A=20=0A--=20=0A2.37.1=20(Apple=20Git-137.1)=0A=0A= --Apple-Mail=_FB47BAD3-5268-4810-80AD-58FECD1A5ED7 Content-Disposition: attachment; filename=0003-Try-to-test-multixact-CV-sleep.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0003-Try-to-test-multixact-CV-sleep.patch" Content-Transfer-Encoding: quoted-printable =46rom=20a61958407770b6cb864e0b245a4341e033824f46=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20"Andrey=20M.=20Borodin"=20=0A= Date:=20Sun,=2028=20Jan=202024=2023:10:55=20+0500=0ASubject:=20[PATCH=20= 3/3]=20Try=20to=20test=20multixact=20CV=20sleep=0A=0A---=0A=20= src/backend/access/transam/multixact.c=20=20=20=20=20=20=20=20|=20=205=20= ++=0A=20.../injection_points--1.0.sql=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20|=2011=20++++=0A=20= .../injection_points/injection_points.c=20=20=20=20=20=20=20|=2026=20= ++++++++=0A=20.../modules/injection_points/t/001_wait.pl=20=20=20=20|=20= 64=20+++++++++++++++++++=0A=204=20files=20changed,=20106=20insertions(+)=0A= =20create=20mode=20100644=20= src/test/modules/injection_points/t/001_wait.pl=0A=0Adiff=20--git=20= a/src/backend/access/transam/multixact.c=20= b/src/backend/access/transam/multixact.c=0Aindex=20= 03fcd25d4c..15b2a0010a=20100644=0A---=20= a/src/backend/access/transam/multixact.c=0A+++=20= b/src/backend/access/transam/multixact.c=0A@@=20-89,6=20+89,7=20@@=0A=20= #include=20"storage/proc.h"=0A=20#include=20"storage/procarray.h"=0A=20= #include=20"utils/builtins.h"=0A+#include=20"utils/injection_point.h"=0A=20= #include=20"utils/memutils.h"=0A=20#include=20"utils/snapmgr.h"=0A=20=0A= @@=20-1200,6=20+1201,8=20@@=20GetNewMultiXactId(int=20nmembers,=20= MultiXactOffset=20*offset)=0A=20=0A=20=09= LWLockRelease(MultiXactGenLock);=0A=20=0A+=09= INJECTION_POINT("GetNewMultiXactId-done");=0A+=0A=20=09= debug_elog4(DEBUG2,=20"GetNew:=20returning=20%u=20offset=20%u",=20= result,=20*offset);=0A=20=09return=20result;=0A=20}=0A@@=20-1408,6=20= +1411,8=20@@=20retry:=0A=20=09=09=09= LWLockRelease(MultiXactOffsetSLRULock);=0A=20=09=09=09= CHECK_FOR_INTERRUPTS();=0A=20=0A+=09=09=09= INJECTION_POINT("GetMultiXactIdMembers-CV-sleep");=0A+=0A=20=09=09=09= ConditionVariableSleep(&MultiXactState->nextoff_cv,=0A=20=09=09=09=09=09=09= =09=09=20=20=20WAIT_EVENT_NEXT_MXMEMBERS);=0A=20=09=09=09= ConditionVariableCancelSleep();=0Adiff=20--git=20= a/src/test/modules/injection_points/injection_points--1.0.sql=20= b/src/test/modules/injection_points/injection_points--1.0.sql=0Aindex=20= 5944c41716..d3ebda5964=20100644=0A---=20= a/src/test/modules/injection_points/injection_points--1.0.sql=0A+++=20= b/src/test/modules/injection_points/injection_points--1.0.sql=0A@@=20= -33,3=20+33,14=20@@=20CREATE=20FUNCTION=20injection_points_detach(IN=20= point_name=20TEXT)=0A=20RETURNS=20void=0A=20AS=20'MODULE_PATHNAME',=20= 'injection_points_detach'=0A=20LANGUAGE=20C=20STRICT=20PARALLEL=20= UNSAFE;=0A+=0A+=0A+CREATE=20FUNCTION=20create_test_multixact()=0A= +RETURNS=20xid=0A+AS=20'MODULE_PATHNAME',=20'create_test_multixact'=0A= +LANGUAGE=20C=20STRICT=20PARALLEL=20UNSAFE;=0A+=0A+CREATE=20FUNCTION=20= read_test_multixact(xid)=0A+RETURNS=20void=0A+AS=20'MODULE_PATHNAME',=20= 'read_test_multixact'=0A+LANGUAGE=20C=20STRICT=20PARALLEL=20UNSAFE;=0A\=20= No=20newline=20at=20end=20of=20file=0Adiff=20--git=20= a/src/test/modules/injection_points/injection_points.c=20= b/src/test/modules/injection_points/injection_points.c=0Aindex=20= fbb30b15ad..d3d5faaa25=20100644=0A---=20= a/src/test/modules/injection_points/injection_points.c=0A+++=20= b/src/test/modules/injection_points/injection_points.c=0A@@=20-109,3=20= +109,29=20@@=20injection_points_detach(PG_FUNCTION_ARGS)=0A=20=0A=20=09= PG_RETURN_VOID();=0A=20}=0A+=0A+#include=20"access/multixact.h"=0A= +#include=20"access/xact.h"=0A+=0A= +PG_FUNCTION_INFO_V1(create_test_multixact);=0A+Datum=0A= +create_test_multixact(PG_FUNCTION_ARGS)=0A+{=0A+=09MultiXactId=20id;=0A= +=09MultiXactIdSetOldestMember();=0A+=09id=20=3D=20= MultiXactIdCreate(GetCurrentTransactionId(),=20MultiXactStatusUpdate,=0A= +=09=09=09=09=09=09GetCurrentTransactionId(),=20= MultiXactStatusForShare);=0A+=09PG_RETURN_TRANSACTIONID(id);=0A+}=0A+=0A= +PG_FUNCTION_INFO_V1(read_test_multixact);=0A+Datum=0A= +read_test_multixact(PG_FUNCTION_ARGS)=0A+{=0A+=09MultiXactId=20id=20=3D=20= PG_GETARG_TRANSACTIONID(0);=0A+=09MultiXactMember=20*members;=0A+=09= INJECTION_POINT("read_test_multixact");=0A+=09if=20= (GetMultiXactIdMembers(id,&members,false,=20false)=20=3D=3D=20-1)=0A+=09=09= elog(ERROR,=20"MultiXactId=20not=20found");=0A+=09PG_RETURN_VOID();=0A+}=0A= \=20No=20newline=20at=20end=20of=20file=0Adiff=20--git=20= a/src/test/modules/injection_points/t/001_wait.pl=20= b/src/test/modules/injection_points/t/001_wait.pl=0Anew=20file=20mode=20= 100644=0Aindex=200000000000..6076ffc6ea=0A---=20/dev/null=0A+++=20= b/src/test/modules/injection_points/t/001_wait.pl=0A@@=20-0,0=20+1,64=20= @@=0A+=0A+#=20Copyright=20(c)=202024,=20PostgreSQL=20Global=20= Development=20Group=0A+=0A+use=20strict;=0A+use=20warnings=20FATAL=20=3D>=20= 'all';=0A+=0A+use=20PostgreSQL::Test::Cluster;=0A+use=20= PostgreSQL::Test::Utils;=0A+=0A+use=20Test::More;=0A+=0A+my=20($node,=20= $result);=0A+=0A+$node=20=3D=20= PostgreSQL::Test::Cluster->new('injection_points');=0A+$node->init;=0A= +$node->start;=0A+$node->safe_psql('postgres',=20q(CREATE=20EXTENSION=20= injection_points));=0A+=0A+$result=20=3D=20$node->psql('postgres',=20= q(select=20injection_points_attach('FIRST','wait')));=0A+is($result,=20= '0',=20'wait=20injection=20point=20set');=0A+=0A+my=20$bg=20=3D=20= $node->background_psql('postgres');=0A+=0A+$bg->query_until(=0A+=09= qr/start/,=20q(=0A+\echo=20start=0A+select=20= injection_points_run('FIRST');=0A+select=20= injection_points_attach('SECOND','wait');=0A+));=0A+=0A+$result=20=3D=20= $node->psql('postgres',=20q(=0A+select=20injection_points_run('SECOND');=0A= +select=20injection_points_detach('FIRST');=0A+));=0A+is($result,=20'0',=20= 'wait=20injection=20point=20set');=0A+=0A+$bg->quit;=0A+=0A= +$node->safe_psql('postgres',=20q(select=20= injection_points_attach('read_test_multixact','wait')));=0A= +$node->safe_psql('postgres',=20q(select=20= injection_points_attach('GetMultiXactIdMembers-CV-sleep','notice')));=0A= +=0A+my=20$observer=20=3D=20$node->background_psql('postgres');=0A+=0A= +$observer->query_safe(=0A+=09q(=0A+select=20= read_test_multixact(create_test_multixact());=0A+));=0A+=0A= +$node->safe_psql('postgres',=20q(select=20= injection_points_attach('GetNewMultiXactId-done','wait')));=0A+=0A+my=20= $creator=20=3D=20$node->background_psql('postgres');=0A+=0A= +$creator->query_safe(=20q(select=20create_test_multixact();));=0A+=0A= +$node->safe_psql('postgres',=20q(select=20= injection_points_detach('read_test_multixact')));=0A+=0A= +$node->safe_psql('postgres',=20q(select=20= injection_points_detach('GetNewMultiXactId-done')));=0A+=0A= +$observer->quit;=0A+=0A+$creator->quit;=0A+=0A+$node->stop;=0A= +done_testing();=0A--=20=0A2.37.1=20(Apple=20Git-137.1)=0A=0A= --Apple-Mail=_FB47BAD3-5268-4810-80AD-58FECD1A5ED7--