From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: bchen90@163.com
Subject: BUG #17226: hot standby mode, create database and drop database cause standby restrat failed
Date: Wed, 13 Oct 2021 08:19:26 +0000
Message-ID: <17226-eef675ff9a8a4f71@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 17226
Logged by: Bo Chen
Email address: bchen90@163.com
PostgreSQL version: 11.8
Operating system: Suse linux 11.3 x86_64
Description:
Hi, all
Recently, I got a FATAL while restarts standby, which can be reproduced by
the following steps, based on pg 11:
1. create a database test
2. create another database test1 using test as template
3. drop database test
4. stop standby using 'pg_ctl stop -mi'
5. start standby, start failed
6. stop primary using 'pg_ctl stop -mi'
7. start primary, start OK
The starting log for standby failed is:
2021-10-13 15:57:43.294 CST startup 2420219 1/0 0 %LOG: 00000: redo starts
at 0/6000024 xlog.c (7043 StartupXLOG)
2021-10-13 15:57:43.297 CST startup 2420219 1/0 0 %FATAL: 58P01: could not
open directory "base/16385": No such file or directory fd.c (2714
ReadDirExtended)
2021-10-13 15:57:43.297 CST startup 2420219 1/0 0 %CONTEXT: WAL redo at
0/7001200 for Database/CREATE: copy dir 16385/1663 to 16386/1663
2021-10-13 15:57:43.298 CST postmaster 2420180 0 %LOG: 00000: startup
process (PID 2420219) exited with exit code 1 postmaster.c (3772
LogChildExit)
I think the reason for the above error is as follows:
For standby, the redo of XLOG_DBASE_DROP and XLOG_DBASE_CREATE just remove
and copy the databse directory but not peform checkpoint like create or drop
database in primary. So, when we restart, it redo from the log of create
database but now the directory of the source database has been deleted, so
redo failed.
So, do we need a force chechpoint in the dbase_redo as we do for create
database or drop database.
Hope to get your reply
Thanks & Best Regard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, bchen90@163.com
Subject: Re: BUG #17226: hot standby mode, create database and drop database cause standby restrat failed
In-Reply-To: <17226-eef675ff9a8a4f71@postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox