Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mQHTL-00079O-8S for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Sep 2021 23:04:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mQHTJ-0002LZ-3l for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Sep 2021 23:04:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mQHTI-0002LR-2s for pgsql-hackers@lists.postgresql.org; Tue, 14 Sep 2021 23:04:12 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mQHTB-0002f4-0g for pgsql-hackers@postgresql.org; Tue, 14 Sep 2021 23:04:10 +0000 Received: by mail-pl1-x632.google.com with SMTP id v2so409901plp.8 for ; Tue, 14 Sep 2021 16:04:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=fzQCtPQfKOeI9AvvD4pb1GMPEBTIVAJ9mSGwq9LysBk=; b=ca2I8OXIqn1wvu590tgepCsXnErLb8fcRWHCYHhkhKteGJnFBGSJruu1sUkVwfURs2 IDjF0ObcOgLmSlBZImIJbpNxGwvM3/nvtwJsTPrAibuqoDadHO03XUJvZbUNAJsVZa3Q owOgqywWgwFzNbmu68Wr8ZfhS5ISP/fW5ercgHpWI+2bvO4y6YwHjD/rvz/nI/5iTsWy OP0RwjkZeTMOAy36g+ieW71J/b+ApjY+S2jUdl/UJWq0woLieef/kcaESxfSO3l0E2yi 8cayGnqvvD1JE8h4My64rpMN33xb0D+NHMkBBSf/FK2SjRXbEHPc79LNWjyhtZqbJVn3 G2sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=fzQCtPQfKOeI9AvvD4pb1GMPEBTIVAJ9mSGwq9LysBk=; b=CyOSlNui2xiYqo7KUHW0LYD7Tg8Pu36SvyoG0NVTFQ04ZGMSPnZ+DFzEkLEzGoXmT9 2GS2o4MhDBjppTo71Y/zKgOL8cIJilgUtz/+XNLh6xsyRzjkzJi6Jf5H7r5amr7NdlqZ pbQnqOX+P+pxgRxtuN3PUBe+QofGOsjxqKUfnJyRQEolxCoVDjIpLPf/kM+QLRP0RAfE yeWhr5kRXIfItDAUlM9eoBk3XGxQqmzmAfJJTSp0KOdNV1t07gWdb0+13ssDY1dpDjZZ /Ga9YR+jR+1ZAy9bu+AiIaIuA72whaa8OoruG/doWBdWvj3Y29z3F1655EbCwM3W2cdN p91g== X-Gm-Message-State: AOAM533m4YNWmY16JS/DTyb3vicKrZNXjk1tZjY3XQwJr6Lwx+U4yG4U lhBksICzMtCOBnqdymTZU2xmxRiUQ88MzZ9fuisvpVg6f5Nzn5gt0SFe9n+WSxMgcbYYkXlgrZK RwlCyui0z9OfJqEhEQhGyw8xlyviT++QjeFpKSvUinVzwk0CKsxqGMiDhJuT8N1/PjTncTz0eUN Y7rk7/BaAvU8lVVb0wc3ZmYS/qUA6e24K7/PAS X-Google-Smtp-Source: ABdhPJy2wulvmDEcaecQA23od6qt+1qoSYK8AAOogsDoK3KkjGVe2lfyGnJ6LrTJWBVL5EbVfCpJmg== X-Received: by 2002:a17:90a:aa85:: with SMTP id l5mr4783908pjq.107.1631660643242; Tue, 14 Sep 2021 16:04:03 -0700 (PDT) Received: from laptop280-ma-us.hitronhub.home (24-113-193-150.wavecable.com. [24.113.193.150]) by smtp.gmail.com with ESMTPSA id d7sm3082844pfa.45.2021.09.14.16.04.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 16:04:02 -0700 (PDT) From: Mark Dilger Message-Id: <9BA3BA57-6B7B-45CB-B8D9-6B5EB0104FFA@enterprisedb.com> Content-Type: multipart/mixed; boundary="Apple-Mail=_9B09373A-8621-4AD0-BF68-48E4D570920F" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: [Patch] ALTER SYSTEM READ ONLY Date: Tue, 14 Sep 2021 16:04:01 -0700 In-Reply-To: Cc: PostgreSQL-development To: amul sul , Andres Freund References: X-Mailer: Apple Mail (2.3608.120.23.2.7) X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_9B09373A-8621-4AD0-BF68-48E4D570920F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Jun 16, 2020, at 6:55 AM, amul sul wrote: >=20 > (2) if the session is idle, we also need the top-level abort > record to be written immediately, but can't send an error to the = client until the next > command is issued without losing wire protocol synchronization. For = now, we just use > FATAL to kill the session; maybe this can be improved in the future. Andres, I'd like to have a patch that tests the impact of a vacuum running for = xid wraparound purposes, blocked on a pinned page held by the cursor, = when another session disables WAL. It would be very interesting to test = how the vacuum handles that specific change. I have not figured out the = cleanest way to do this, though, as we don't as a project yet have a = standard way of setting up xid exhaustion in a regression test, do we? = The closest I saw to it was your work in [1], but that doesn't seem to = have made much headway recently, and is designed for the TAP testing = infrastructure, which isn't useable from inside an isolation test. Do = you have a suggestion how best to continue developing out the test = infrastructure? Amul, The most obvious way to test how your ALTER SYSTEM READ ONLY feature = interacts with concurrent sessions is using the isolation tester in = src/test/isolation/, but as it stands now, the first permutation that = gets a FATAL causes the test to abort and all subsequent permutations to = not run. Attached patch v34-0009 fixes that. Attached patch v34-0010 adds a test of cursors opened FOR UPDATE = interacting with a system that is set read-only by a different session. = The expected output is worth reviewing to see how this plays out. I = don't see anything in there which is obviously wrong, but some of it is = a bit clunky. For example, by the time the client sees an error "FATAL: = WAL is now prohibited", the system may already have switched back to = read-write. Also, it is a bit strange to get one of these errors on an = attempted ROLLBACK. Once again, not wrong as such, but clunky. --Apple-Mail=_9B09373A-8621-4AD0-BF68-48E4D570920F Content-Disposition: attachment; filename=v34-0009-Make-isolationtester-handle-closed-sessions.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="v34-0009-Make-isolationtester-handle-closed-sessions.patch" Content-Transfer-Encoding: quoted-printable =46rom=20b7c21e95c9a48208f1aec377366b26e40cf9ecb4=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Mark=20Dilger=20=0A= Date:=20Tue,=2014=20Sep=202021=2015:18:52=20-0700=0ASubject:=20[PATCH=20= v34=2009/10]=20Make=20isolationtester=20handle=20closed=20sessions.=0A=0A= The=20recent=20implementation=20of=20ALTER=20SYSTEM=20READ=20ONLY=20= should=20be=0Atestable=20from=20src/test/isolation.=20=20For=20that,=20= the=20isolation=20tester=0Aneeds=20to=20reconnect=20after=20getting=20= kicked=20out=20rather=20than=20aborting.=0A---=0A=20= src/test/isolation/isolationtester.c=20|=2024=20++++++++++++++++++++++--=0A= =201=20file=20changed,=2022=20insertions(+),=202=20deletions(-)=0A=0A= diff=20--git=20a/src/test/isolation/isolationtester.c=20= b/src/test/isolation/isolationtester.c=0Aindex=2088594a3cb5..87cf88cbec=20= 100644=0A---=20a/src/test/isolation/isolationtester.c=0A+++=20= b/src/test/isolation/isolationtester.c=0A@@=20-85,6=20+85,24=20@@=20= disconnect_atexit(void)=0A=20=09=09=09PQfinish(conns[i].conn);=0A=20}=0A=20= =0A+static=20void=0A+restore_connection(PGconn=20*conn)=0A+{=0A+=09if=20= (PQstatus(conn)=20!=3D=20CONNECTION_BAD)=0A+=09=09return;=0A+=0A+=09= fprintf(stderr,=0A+=09=09=09_("The=20connection=20to=20the=20server=20= was=20lost.=20Attempting=20reset:=20"));=0A+=09PQreset(conn);=0A+=09if=20= (PQstatus(conn)=20=3D=3D=20CONNECTION_BAD)=0A+=09{=0A+=09=09= fprintf(stderr,=20_("Failed.\n"));=0A+=09=09exit(1);=0A+=09}=0A+=09else=0A= +=09=09fprintf(stderr,=20_("Succeeded.\n"));=0A+}=0A+=0A=20int=0A=20= main(int=20argc,=20char=20**argv)=0A=20{=0A@@=20-890,7=20+908,7=20@@=20= try_complete_step(TestSpec=20*testspec,=20PermutationStep=20*pstep,=20= int=20flags)=0A=20=09=09=09=09=09{=0A=20=09=09=09=09=09=09= fprintf(stderr,=20"PQconsumeInput=20failed:=20%s\n",=0A=20=09=09=09=09=09= =09=09=09PQerrorMessage(conn));=0A-=09=09=09=09=09=09exit(1);=0A+=09=09=09= =09=09=09restore_connection(conn);=0A=20=09=09=09=09=09}=0A=20=09=09=09=09= =09if=20(!PQisBusy(conn))=0A=20=09=09=09=09=09=09break;=0A@@=20-964,7=20= +982,7=20@@=20try_complete_step(TestSpec=20*testspec,=20PermutationStep=20= *pstep,=20int=20flags)=0A=20=09=09{=0A=20=09=09=09fprintf(stderr,=20= "PQconsumeInput=20failed:=20%s\n",=0A=20=09=09=09=09=09= PQerrorMessage(conn));=0A-=09=09=09exit(1);=0A+=09=09=09= restore_connection(conn);=0A=20=09=09}=0A=20=09}=0A=20=0A@@=20-1013,6=20= +1031,8=20@@=20try_complete_step(TestSpec=20*testspec,=20PermutationStep=20= *pstep,=20int=20flags)=0A=20=09=09=09=09=09=09printf("%s:=20=20%s\n",=20= sev,=20msg);=0A=20=09=09=09=09=09else=0A=20=09=09=09=09=09=09= printf("%s\n",=20PQresultErrorMessage(res));=0A+=0A+=09=09=09=09=09= restore_connection(conn);=0A=20=09=09=09=09}=0A=20=09=09=09=09break;=0A=20= =09=09=09default:=0A--=20=0A2.21.1=20(Apple=20Git-122.3)=0A=0A= --Apple-Mail=_9B09373A-8621-4AD0-BF68-48E4D570920F Content-Disposition: attachment; filename=v34-0010-Test-ALTER-SYSTEM-READ-ONLY-against-cursors.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="v34-0010-Test-ALTER-SYSTEM-READ-ONLY-against-cursors.patch" Content-Transfer-Encoding: quoted-printable =46rom=20ce3054a97c78325b06e67219fe0be3535b7be272=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Mark=20Dilger=20=0A= Date:=20Tue,=2014=20Sep=202021=2015:28:09=20-0700=0ASubject:=20[PATCH=20= v34=2010/10]=20Test=20ALTER=20SYSTEM=20READ=20ONLY=20against=20cursors.=0A= =0AAdd=20an=20isolation=20test=20which=20checks=20the=20impact=20of=20= setting=20the=20system=0Aread-only=20upon=20cursors=20that=20use=20a=20= FOR=20UPDATE=20query.=0A---=0A=20.../expected/cursor-prohibit-wal.out=20=20= =20=20=20=20=20=20=20=20|=20157=20++++++++++++++++++=0A=20= src/test/isolation/isolation_schedule=20=20=20=20=20=20=20=20=20|=20=20=20= 1=20+=0A=20.../isolation/specs/cursor-prohibit-wal.spec=20=20|=20=2038=20= +++++=0A=203=20files=20changed,=20196=20insertions(+)=0A=20create=20mode=20= 100644=20src/test/isolation/expected/cursor-prohibit-wal.out=0A=20create=20= mode=20100644=20src/test/isolation/specs/cursor-prohibit-wal.spec=0A=0A= diff=20--git=20a/src/test/isolation/expected/cursor-prohibit-wal.out=20= b/src/test/isolation/expected/cursor-prohibit-wal.out=0Anew=20file=20= mode=20100644=0Aindex=200000000000..6b479143a6=0A---=20/dev/null=0A+++=20= b/src/test/isolation/expected/cursor-prohibit-wal.out=0A@@=20-0,0=20= +1,157=20@@=0A+Parsed=20test=20spec=20with=202=20sessions=0A+=0A= +starting=20permutation:=20s1a=20s1b=20s1c=20s2a=20s2b=20s1d=0A+step=20= s1a:=20DECLARE=20rw_cur=20CURSOR=20FOR=20SELECT=20a=20FROM=20tbl=20WHERE=20= a=20=3D=205000=20FOR=20UPDATE;=0A+step=20s1b:=20FETCH=20FORWARD=20ALL=20= FROM=20rw_cur;=0A+=20=20=20a=0A+----=0A+5000=0A+(1=20row)=0A+=0A+step=20= s1c:=20CLOSE=20ALL;=0A+step=20s2a:=20SELECT=20pg_prohibit_wal(true);=0A= +pg_prohibit_wal=0A+---------------=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=0A+(1=20row)=0A+=0A+step=20s2b:=20SELECT=20= pg_prohibit_wal(false);=0A+pg_prohibit_wal=0A+---------------=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=0A+(1=20row)=0A+=0A+PQconsumeInput=20= failed:=20FATAL:=20=20WAL=20is=20now=20prohibited=0A+HINT:=20=20Sessions=20= with=20open=20write=20transactions=20must=20be=20terminated.=0A+server=20= closed=20the=20connection=20unexpectedly=0A+=09This=20probably=20means=20= the=20server=20terminated=20abnormally=0A+=09before=20or=20while=20= processing=20the=20request.=0A+=0A+The=20connection=20to=20the=20server=20= was=20lost.=20Attempting=20reset:=20Succeeded.=0A+step=20s1d:=20= ROLLBACK;=0A+=0A+starting=20permutation:=20s1a=20s1b=20s2a=20s1c=20s2b=20= s1d=0A+step=20s1a:=20DECLARE=20rw_cur=20CURSOR=20FOR=20SELECT=20a=20FROM=20= tbl=20WHERE=20a=20=3D=205000=20FOR=20UPDATE;=0A+step=20s1b:=20FETCH=20= FORWARD=20ALL=20FROM=20rw_cur;=0A+=20=20=20a=0A+----=0A+5000=0A+(1=20= row)=0A+=0A+step=20s2a:=20SELECT=20pg_prohibit_wal(true);=0A= +pg_prohibit_wal=0A+---------------=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=0A+(1=20row)=0A+=0A+step=20s1c:=20CLOSE=20ALL;=0A+FATAL:=20=20= WAL=20is=20now=20prohibited=0A+FATAL:=20=20WAL=20is=20now=20prohibited=0A= +HINT:=20=20Sessions=20with=20open=20write=20transactions=20must=20be=20= terminated.=0A+server=20closed=20the=20connection=20unexpectedly=0A+=09= This=20probably=20means=20the=20server=20terminated=20abnormally=0A+=09= before=20or=20while=20processing=20the=20request.=0A+=0A+The=20= connection=20to=20the=20server=20was=20lost.=20Attempting=20reset:=20= Succeeded.=0A+step=20s2b:=20SELECT=20pg_prohibit_wal(false);=0A= +pg_prohibit_wal=0A+---------------=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=0A+(1=20row)=0A+=0A+s1:=20WARNING:=20=20there=20is=20no=20= transaction=20in=20progress=0A+step=20s1d:=20ROLLBACK;=0A+=0A+starting=20= permutation:=20s1a=20s1b=20s2a=20s2b=20s1c=20s1d=0A+step=20s1a:=20= DECLARE=20rw_cur=20CURSOR=20FOR=20SELECT=20a=20FROM=20tbl=20WHERE=20a=20= =3D=205000=20FOR=20UPDATE;=0A+step=20s1b:=20FETCH=20FORWARD=20ALL=20FROM=20= rw_cur;=0A+=20=20=20a=0A+----=0A+5000=0A+(1=20row)=0A+=0A+step=20s2a:=20= SELECT=20pg_prohibit_wal(true);=0A+pg_prohibit_wal=0A+---------------=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=0A+(1=20row)=0A+=0A+step=20= s2b:=20SELECT=20pg_prohibit_wal(false);=0A+pg_prohibit_wal=0A= +---------------=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=0A+(1=20= row)=0A+=0A+PQconsumeInput=20failed:=20FATAL:=20=20WAL=20is=20now=20= prohibited=0A+HINT:=20=20Sessions=20with=20open=20write=20transactions=20= must=20be=20terminated.=0A+server=20closed=20the=20connection=20= unexpectedly=0A+=09This=20probably=20means=20the=20server=20terminated=20= abnormally=0A+=09before=20or=20while=20processing=20the=20request.=0A+=0A= +The=20connection=20to=20the=20server=20was=20lost.=20Attempting=20= reset:=20Succeeded.=0A+step=20s1c:=20CLOSE=20ALL;=0A+s1:=20WARNING:=20=20= there=20is=20no=20transaction=20in=20progress=0A+step=20s1d:=20ROLLBACK;=0A= +=0A+starting=20permutation:=20s1a=20s2a=20s1b=20s1c=20s2b=20s1d=0A+step=20= s1a:=20DECLARE=20rw_cur=20CURSOR=20FOR=20SELECT=20a=20FROM=20tbl=20WHERE=20= a=20=3D=205000=20FOR=20UPDATE;=0A+step=20s2a:=20SELECT=20= pg_prohibit_wal(true);=0A+pg_prohibit_wal=0A+---------------=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=0A+(1=20row)=0A+=0A+step=20s1b:=20= FETCH=20FORWARD=20ALL=20FROM=20rw_cur;=0A+ERROR:=20=20WAL=20is=20now=20= prohibited=0A+step=20s1c:=20CLOSE=20ALL;=0A+ERROR:=20=20current=20= transaction=20is=20aborted,=20commands=20ignored=20until=20end=20of=20= transaction=20block=0A+step=20s2b:=20SELECT=20pg_prohibit_wal(false);=0A= +pg_prohibit_wal=0A+---------------=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=0A+(1=20row)=0A+=0A+step=20s1d:=20ROLLBACK;=0A+=0A+starting=20= permutation:=20s1a=20s2a=20s1b=20s2b=20s1c=20s1d=0A+step=20s1a:=20= DECLARE=20rw_cur=20CURSOR=20FOR=20SELECT=20a=20FROM=20tbl=20WHERE=20a=20= =3D=205000=20FOR=20UPDATE;=0A+step=20s2a:=20SELECT=20= pg_prohibit_wal(true);=0A+pg_prohibit_wal=0A+---------------=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=0A+(1=20row)=0A+=0A+step=20s1b:=20= FETCH=20FORWARD=20ALL=20FROM=20rw_cur;=0A+ERROR:=20=20WAL=20is=20now=20= prohibited=0A+step=20s2b:=20SELECT=20pg_prohibit_wal(false);=0A= +pg_prohibit_wal=0A+---------------=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=0A+(1=20row)=0A+=0A+step=20s1c:=20CLOSE=20ALL;=0A+ERROR:=20=20= current=20transaction=20is=20aborted,=20commands=20ignored=20until=20end=20= of=20transaction=20block=0A+step=20s1d:=20ROLLBACK;=0A+=0A+starting=20= permutation:=20s1a=20s2a=20s2b=20s1b=20s1c=20s1d=0A+step=20s1a:=20= DECLARE=20rw_cur=20CURSOR=20FOR=20SELECT=20a=20FROM=20tbl=20WHERE=20a=20= =3D=205000=20FOR=20UPDATE;=0A+step=20s2a:=20SELECT=20= pg_prohibit_wal(true);=0A+pg_prohibit_wal=0A+---------------=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=0A+(1=20row)=0A+=0A+step=20s2b:=20= SELECT=20pg_prohibit_wal(false);=0A+pg_prohibit_wal=0A+---------------=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=0A+(1=20row)=0A+=0A+step=20= s1b:=20FETCH=20FORWARD=20ALL=20FROM=20rw_cur;=0A+=20=20=20a=0A+----=0A= +5000=0A+(1=20row)=0A+=0A+step=20s1c:=20CLOSE=20ALL;=0A+step=20s1d:=20= ROLLBACK;=0Adiff=20--git=20a/src/test/isolation/isolation_schedule=20= b/src/test/isolation/isolation_schedule=0Aindex=20f4c01006fc..fb79e010b0=20= 100644=0A---=20a/src/test/isolation/isolation_schedule=0A+++=20= b/src/test/isolation/isolation_schedule=0A@@=20-96,3=20+96,4=20@@=20= test:=20plpgsql-toast=0A=20test:=20truncate-conflict=0A=20test:=20= serializable-parallel=0A=20test:=20serializable-parallel-2=0A+test:=20= cursor-prohibit-wal=0Adiff=20--git=20= a/src/test/isolation/specs/cursor-prohibit-wal.spec=20= b/src/test/isolation/specs/cursor-prohibit-wal.spec=0Anew=20file=20mode=20= 100644=0Aindex=200000000000..8f699a4c6e=0A---=20/dev/null=0A+++=20= b/src/test/isolation/specs/cursor-prohibit-wal.spec=0A@@=20-0,0=20+1,38=20= @@=0A+#=20Test=20for=20behavior=20of=20a=20cursor=20over=20an=20index=20= scan=20when=20the=20server=20is=20read-only=0A+#=20and=20the=20cursor=20= moves=20over=20index=20pages=20that=20refer=20to=20dead=20tuples.=20=20= The=20key=0A+#=20point=20is=20that=20the=20server=20is=20read-only,=20= but=20the=20scan=20of=20the=20index=20page=20will=0A+#=20want=20to=20= hint=20the=20tuples=20as=20dead.=0A+#=20=0A+#=20The=20transaction=20= operating=20the=20cursor=20is=20intentionally=20read-only=20in=20its=0A= +#=20behavior.=20=20If=20it=20were=20to=20do=20anything=20that=20= generated=20a=20transaction=20ID,=20we=0A+#=20would=20expect=20it=20to=20= be=20terminated=20when=20the=20server=20goes=20read-only.=0A+#=0A+=0A= +setup=0A+{=0A+=09CREATE=20TABLE=20tbl=20(a=20integer);=0A+=09INSERT=20= INTO=20tbl=20SELECT=20*=20FROM=20generate_series(1,10000);=0A+}=0A+=0A= +teardown=0A+{=0A+=09DROP=20TABLE=20tbl;=0A+}=0A+=0A+session=20s1=0A= +setup=09=09=09{=20BEGIN;=20}=0A+step=20s1a=09=09{=20DECLARE=20rw_cur=20= CURSOR=20FOR=20SELECT=20a=20FROM=20tbl=20WHERE=20a=20=3D=205000=20FOR=20= UPDATE;=20}=0A+step=20s1b=09=09{=20FETCH=20FORWARD=20ALL=20FROM=20= rw_cur;=20}=0A+step=20s1c=09=09{=20CLOSE=20ALL;=20}=0A+step=20s1d=09=09{=20= ROLLBACK;=20}=0A+=0A+session=20s2=0A+step=20s2a=09=09{=20SELECT=20= pg_prohibit_wal(true);=20}=0A+step=20s2b=09=09{=20SELECT=20= pg_prohibit_wal(false);=20}=0A+=0A+permutation=09=09s1a=20s1b=20s1c=20= s2a=20s2b=20s1d=0A+permutation=09=09s1a=20s1b=20s2a=20s1c=20s2b=20s1d=0A= +permutation=09=09s1a=20s1b=20s2a=20s2b=20s1c=20s1d=0A+permutation=09=09= s1a=20s2a=20s1b=20s1c=20s2b=20s1d=0A+permutation=09=09s1a=20s2a=20s1b=20= s2b=20s1c=20s1d=0A+permutation=09=09s1a=20s2a=20s2b=20s1b=20s1c=20s1d=0A= --=20=0A2.21.1=20(Apple=20Git-122.3)=0A=0A= --Apple-Mail=_9B09373A-8621-4AD0-BF68-48E4D570920F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 [1] = https://www.postgresql.org/message-id/flat/CAP4vRV5gEHFLB7NwOE6_dyHAeVfkvq= F8Z_g5GaCQZNgBAE0Frw%40mail.gmail.com#e10861372aec22119b66756ecbac581c =E2=80=94 Mark Dilger EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company --Apple-Mail=_9B09373A-8621-4AD0-BF68-48E4D570920F--