pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
9.0 standby - could not open file global/XXXXX
6+ messages / 3 participants
[nested] [flat]

* 9.0 standby - could not open file global/XXXXX
@ 2019-02-25 19:06 Filip Rembiałkowski <filip.rembialkowski@gmail.com>
  2019-02-25 22:45 ` Re: 9.0 standby - could not open file global/XXXXX Stephen Frost <sfrost@snowman.net>
  2019-02-26 01:39 ` Re: 9.0 standby - could not open file global/XXXXX Andres Freund <andres@anarazel.de>
  2019-02-27 16:00 ` Re: 9.0 standby - could not open file global/XXXXX Filip Rembiałkowski <filip.rembialkowski@gmail.com>
  0 siblings, 3 replies; 6+ messages in thread

From: Filip Rembiałkowski @ 2019-02-25 19:06 UTC (permalink / raw)
  To: pgsql-general

Hi.

There is a large (>5T) database on PostgreSQL 9.0.23.

I would like to setup new WAL-shipping standby.
https://www.postgresql.org/docs/9.0/warm-standby.html

On my way I find unexpected issues. Here's the story, in short:

1. WAL archiving to remote archive is setup & verified

2. base backup is transferred directly to new server using
pg_start_backup + rsync + pg_stop_backup.

3. recovery.conf is created

4. Server is started and consumes all the remaining WAL segments
accumulated in the archive - finishing with optimistic message LOG:
consistent recovery state reached at 9FC1/112BEE10.

5. When I go to postgres on the standby and try to connect system
"postgres" database psql: FATAL:  could not open file "global/11819":
No such file or directory

I guessed the OID refereds to the pg_authid, but other system tables
might be affected too.

What could be wrong here?

Thanks!




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: 9.0 standby - could not open file global/XXXXX
  2019-02-25 19:06 9.0 standby - could not open file global/XXXXX Filip Rembiałkowski <filip.rembialkowski@gmail.com>
@ 2019-02-25 22:45 ` Stephen Frost <sfrost@snowman.net>
  2019-02-26 09:43   ` Re: 9.0 standby - could not open file global/XXXXX Filip Rembiałkowski <filip.rembialkowski@gmail.com>
  2 siblings, 1 reply; 6+ messages in thread

From: Stephen Frost @ 2019-02-25 22:45 UTC (permalink / raw)
  To: Filip Rembiałkowski <filip.rembialkowski@gmail.com>; +Cc: pgsql-general

Greetings,

* Filip Rembiałkowski (filip.rembialkowski@gmail.com) wrote:
> There is a large (>5T) database on PostgreSQL 9.0.23.

First off, I hope you understand that 9.0 has been *long* out of
support and that you *really* need to upgrade to a supported version of
PostgreSQL (9.4 and up these days...).

> I would like to setup new WAL-shipping standby.
> https://www.postgresql.org/docs/9.0/warm-standby.html
> 
> On my way I find unexpected issues. Here's the story, in short:
> 
> 1. WAL archiving to remote archive is setup & verified
> 
> 2. base backup is transferred directly to new server using
> pg_start_backup + rsync + pg_stop_backup.
> 
> 3. recovery.conf is created
> 
> 4. Server is started and consumes all the remaining WAL segments
> accumulated in the archive - finishing with optimistic message LOG:
> consistent recovery state reached at 9FC1/112BEE10.
> 
> 5. When I go to postgres on the standby and try to connect system
> "postgres" database psql: FATAL:  could not open file "global/11819":
> No such file or directory

That seems pretty odd- does that file exist on the existing database
system..?

Thanks!

Stephen

Attachments:

  signature.asc (application/pgp-signature, 818B) download

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: 9.0 standby - could not open file global/XXXXX
  2019-02-25 19:06 9.0 standby - could not open file global/XXXXX Filip Rembiałkowski <filip.rembialkowski@gmail.com>
  2019-02-25 22:45 ` Re: 9.0 standby - could not open file global/XXXXX Stephen Frost <sfrost@snowman.net>
@ 2019-02-26 09:43   ` Filip Rembiałkowski <filip.rembialkowski@gmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Filip Rembiałkowski @ 2019-02-26 09:43 UTC (permalink / raw)
  To: Stephen Frost <sfrost@snowman.net>; +Cc: pgsql-general

On Mon, Feb 25, 2019 at 11:45 PM Stephen Frost <sfrost@snowman.net> wrote:
>
> Greetings,
>
> * Filip Rembiałkowski (filip.rembialkowski@gmail.com) wrote:
> > There is a large (>5T) database on PostgreSQL 9.0.23.
>
> First off, I hope you understand that 9.0 has been *long* out of
> support and that you *really* need to upgrade to a supported version of
> PostgreSQL (9.4 and up these days...).

Yes I do. Unfortunately it was not possible.

>> > I would like to setup new WAL-shipping standby.
> > https://www.postgresql.org/docs/9.0/warm-standby.html
> >
> > On my way I find unexpected issues. Here's the story, in short:
> >
> > 1. WAL archiving to remote archive is setup & verified
> >
> > 2. base backup is transferred directly to new server using
> > pg_start_backup + rsync + pg_stop_backup.
> >
> > 3. recovery.conf is created
> >
> > 4. Server is started and consumes all the remaining WAL segments
> > accumulated in the archive - finishing with optimistic message LOG:
> > consistent recovery state reached at 9FC1/112BEE10.
> >
> > 5. When I go to postgres on the standby and try to connect system
> > "postgres" database psql: FATAL:  could not open file "global/11819":
> > No such file or directory
>
> That seems pretty odd- does that file exist on the existing database
> system..?

No. "global/11819" does not exist on the primary. That's what makes it
a mystery for me.

At first, I was thinking - maybe OIDs of some objects in pg_global
tablespace were "rotated" (VACUUM FULL, etc) during the rsync.
But it seems unlikely.




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: 9.0 standby - could not open file global/XXXXX
  2019-02-25 19:06 9.0 standby - could not open file global/XXXXX Filip Rembiałkowski <filip.rembialkowski@gmail.com>
@ 2019-02-26 01:39 ` Andres Freund <andres@anarazel.de>
  2019-02-26 11:45   ` Re: 9.0 standby - could not open file global/XXXXX Filip Rembiałkowski <filip.rembialkowski@gmail.com>
  2 siblings, 1 reply; 6+ messages in thread

From: Andres Freund @ 2019-02-26 01:39 UTC (permalink / raw)
  To: Filip Rembiałkowski <filip.rembialkowski@gmail.com>; +Cc: pgsql-general

Hi,

On 2019-02-25 20:06:42 +0100, Filip Rembiałkowski wrote:
> There is a large (>5T) database on PostgreSQL 9.0.23.

As Stephen said, this is long out of support.


> 2. base backup is transferred directly to new server using
> pg_start_backup + rsync + pg_stop_backup.

Do you exclude any files? Remove any? If so which?

Greetings,

Andres Freund




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: 9.0 standby - could not open file global/XXXXX
  2019-02-25 19:06 9.0 standby - could not open file global/XXXXX Filip Rembiałkowski <filip.rembialkowski@gmail.com>
  2019-02-26 01:39 ` Re: 9.0 standby - could not open file global/XXXXX Andres Freund <andres@anarazel.de>
@ 2019-02-26 11:45   ` Filip Rembiałkowski <filip.rembialkowski@gmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Filip Rembiałkowski @ 2019-02-26 11:45 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: pgsql-general

On Tue, Feb 26, 2019 at 2:39 AM Andres Freund <andres@anarazel.de> wrote:
>
> > 2. base backup is transferred directly to new server using
> > pg_start_backup + rsync + pg_stop_backup.
>

I excluded contents of pg_xlog only. Exact command was:

# start script
psql -Xc "select pg_start_backup('mirror to $standby', true)"
( cd $PGDATA \
  && find . -type d \( -path ./pg_xlog \) -prune -o -type f -print \
  | xargs -n $nargs \
  | xargs -P $njobs -I {} bash -c "while ! rsync -a -u -z -R --inplace
{} $standby:$PGDATA; do echo retrying; done"
)
psql -Xc "select pg_stop_backup()"
# end script

Actually I am now in the process of repeating this with
single-threaded rsync - and I'll see if same issue happens.
This is what I'm going to use:

rsync -a -z --inplace $PGDATA/ $standby:$PGDATA/


But it's unlikely to change anything. Still no idea what could be the
root cause.


Thanks!




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: 9.0 standby - could not open file global/XXXXX
  2019-02-25 19:06 9.0 standby - could not open file global/XXXXX Filip Rembiałkowski <filip.rembialkowski@gmail.com>
@ 2019-02-27 16:00 ` Filip Rembiałkowski <filip.rembialkowski@gmail.com>
  2 siblings, 0 replies; 6+ messages in thread

From: Filip Rembiałkowski @ 2019-02-27 16:00 UTC (permalink / raw)
  To: pgsql-general

OK I have it fixed;; just for anyone who's interested - the error was in
the base backup procedure.
When switched to plain "rsync -az" - it  works like a charm.

Most probably, the fault was I assumed that you can use the rsync --update
option when doing base backup.
You cannot, especially when time sync on both servers is not accurate. In
my case, destination server clock was few minutes in future.
So the pg_clog was broken due to this. Which means a completely corrupted
database.

thanks Stephen & Andres for your responses.



On Mon, Feb 25, 2019 at 8:06 PM Filip Rembiałkowski <
filip.rembialkowski@gmail.com> wrote:

> Hi.
>
> There is a large (>5T) database on PostgreSQL 9.0.23.
>
> I would like to setup new WAL-shipping standby.
> https://www.postgresql.org/docs/9.0/warm-standby.html
>
> On my way I find unexpected issues. Here's the story, in short:
>
> 1. WAL archiving to remote archive is setup & verified
>
> 2. base backup is transferred directly to new server using
> pg_start_backup + rsync + pg_stop_backup.
>
> 3. recovery.conf is created
>
> 4. Server is started and consumes all the remaining WAL segments
> accumulated in the archive - finishing with optimistic message LOG:
> consistent recovery state reached at 9FC1/112BEE10.
>
> 5. When I go to postgres on the standby and try to connect system
> "postgres" database psql: FATAL:  could not open file "global/11819":
> No such file or directory
>
> I guessed the OID refereds to the pg_authid, but other system tables
> might be affected too.
>
> What could be wrong here?
>
> Thanks!
>

^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2019-02-27 16:00 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-02-25 19:06 9.0 standby - could not open file global/XXXXX Filip Rembiałkowski <filip.rembialkowski@gmail.com>
2019-02-25 22:45 ` Stephen Frost <sfrost@snowman.net>
2019-02-26 09:43   ` Filip Rembiałkowski <filip.rembialkowski@gmail.com>
2019-02-26 01:39 ` Andres Freund <andres@anarazel.de>
2019-02-26 11:45   ` Filip Rembiałkowski <filip.rembialkowski@gmail.com>
2019-02-27 16:00 ` Filip Rembiałkowski <filip.rembialkowski@gmail.com>

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