Re: [Patch] ALTER SYSTEM READ ONLY

From: Prabhat Sahu <prabhat(dot)sahu(at)enterprisedb(dot)com>
To: Amul Sul <sulamul(at)gmail(dot)com>
Cc: Ibrar Ahmed <ibrar(dot)ahmad(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [Patch] ALTER SYSTEM READ ONLY
Date: 2021-03-19 13:46:55
Message-ID: CANEvxPqWGfeka+tS4PNr7Dcvj_44wztQV2-wey6_G3UJCSKaFA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,
While testing this feature with v20-patch, the server is crashing with
below steps.

Steps to reproduce:
1. Configure master-slave replication setup.
2. Connect to Slave.
3. Execute below statements, it will crash the server:
SELECT pg_prohibit_wal(true);
SELECT pg_prohibit_wal(false);

-- Slave:
postgres=# select pg_is_in_recovery();
pg_is_in_recovery
-------------------
t
(1 row)

postgres=# SELECT pg_prohibit_wal(true);
pg_prohibit_wal
-----------------

(1 row)

postgres=# SELECT pg_prohibit_wal(false);
WARNING: terminating connection because of crash of another server process
DETAIL: The postmaster has commanded this server process to roll back the
current transaction and exit, because another server process exited
abnormally and possibly corrupted shared memory.
HINT: In a moment you should be able to reconnect to the database and
repeat your command.
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!?>

-- Below are the stack trace:
[prabhat(at)localhost bin]$ gdb -q -c /tmp/data_slave/core.35273 postgres
Reading symbols from
/home/prabhat/PG/PGsrcNew/postgresql/inst/bin/postgres...done.
[New LWP 35273]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `postgres: checkpointer
'.
Program terminated with signal 6, Aborted.
#0 0x00007fa876233387 in raise () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install
glibc-2.17-317.el7.x86_64 keyutils-libs-1.5.8-3.el7.x86_64
krb5-libs-1.15.1-50.el7.x86_64 libcom_err-1.42.9-19.el7.x86_64
libgcc-4.8.5-44.el7.x86_64 libselinux-2.5-15.el7.x86_64
openssl-libs-1.0.2k-21.el7_9.x86_64 pcre-8.32-17.el7.x86_64
zlib-1.2.7-18.el7.x86_64
(gdb) bt
#0 0x00007fa876233387 in raise () from /lib64/libc.so.6
#1 0x00007fa876234a78 in abort () from /lib64/libc.so.6
#2 0x0000000000aea31c in ExceptionalCondition (conditionName=0xb8c998
"ThisTimeLineID != 0 || IsBootstrapProcessingMode()",
errorType=0xb8956d "FailedAssertion", fileName=0xb897c0 "xlog.c",
lineNumber=8611) at assert.c:69
#3 0x0000000000588eb5 in InitXLOGAccess () at xlog.c:8611
#4 0x0000000000588ae6 in LocalSetXLogInsertAllowed () at xlog.c:8483
#5 0x00000000005881bb in XLogAcceptWrites (needChkpt=true, xlogreader=0x0,
EndOfLog=0, EndOfLogTLI=0) at xlog.c:8008
#6 0x00000000005751ed in ProcessWALProhibitStateChangeRequest () at
walprohibit.c:361
#7 0x000000000088c69f in CheckpointerMain () at checkpointer.c:355
#8 0x000000000059d7db in AuxiliaryProcessMain (argc=2,
argv=0x7ffd1290d060) at bootstrap.c:455
#9 0x000000000089fc5f in StartChildProcess (type=CheckpointerProcess) at
postmaster.c:5416
#10 0x000000000089f782 in sigusr1_handler (postgres_signal_arg=10) at
postmaster.c:5128
#11 <signal handler called>
#12 0x00007fa8762f2983 in __select_nocancel () from /lib64/libc.so.6
#13 0x000000000089b511 in ServerLoop () at postmaster.c:1700
#14 0x000000000089af00 in PostmasterMain (argc=5, argv=0x15b8460) at
postmaster.c:1408
#15 0x000000000079c23a in main (argc=5, argv=0x15b8460) at main.c:209
(gdb)

kindly let me know if you need more inputs on this.

On Mon, Mar 15, 2021 at 12:56 PM Amul Sul <sulamul(at)gmail(dot)com> wrote:

> On Sun, Mar 14, 2021 at 11:51 PM Ibrar Ahmed <ibrar(dot)ahmad(at)gmail(dot)com>
> wrote:
> >
> > On Tue, Mar 9, 2021 at 3:31 PM Amul Sul <sulamul(at)gmail(dot)com> wrote:
> >>
> >> On Thu, Mar 4, 2021 at 11:02 PM Amul Sul <sulamul(at)gmail(dot)com> wrote:
> >> >
> >> > On Wed, Mar 3, 2021 at 8:56 PM Robert Haas <robertmhaas(at)gmail(dot)com>
> wrote:
> >> > >
> >> > > On Tue, Mar 2, 2021 at 7:22 AM Dilip Kumar <dilipbalaut(at)gmail(dot)com>
> wrote:
> >[....]
> >
> > One of the patch
> (v18-0002-Error-or-Assert-before-START_CRIT_SECTION-for-WA.patch) from the
> latest patchset does not apply successfully.
> >
> > http://cfbot.cputube.org/patch_32_2602.log
> >
> > === applying patch
> ./v18-0002-Error-or-Assert-before-START_CRIT_SECTION-for-WA.patch
> >
> > Hunk #15 succeeded at 2604 (offset -13 lines).
> > 1 out of 15 hunks FAILED -- saving rejects to file
> src/backend/access/nbtree/nbtpage.c.rej
> > patching file src/backend/access/spgist/spgdoinsert.c
> >
> > It is a very minor change, so I rebased the patch. Please take a look,
> if that works for you.
> >
>
> Thanks, I am getting one more failure for the vacuumlazy.c. on the
> latest master head(d75288fb27b), I fixed that in attached version.
>
> Regards,
> Amul
>

--

With Regards,
Prabhat Kumar Sahu
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2021-03-19 13:49:33 Re: SQL-standard function body
Previous Message Bruce Momjian 2021-03-19 13:29:06 Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?