Re: HotStandby vs. flatfile updates

Lists: pgsql-hackers
From: Bernd Helmle <mailings(at)oopsware(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: HotStandby vs. flatfile updates
Date: 2009-02-11 14:49:24
Message-ID: FA792E2899B619C3B5BF80FE@teje
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I'm currently facing with a strange behavior during HotStandby Testing.
That's what i'm actually doing:

MASTER:

CREATE DATABASE foo;
<do something in there, e.g. restoring a dump>

<wait until xlog segments get consumed by standby node (using
archive_timeout)>

STANDBY:

postgres=# SELECT oid, datname FROM pg_database;
oid | datname
-------+-----------
1 | template1
11561 | template0
11562 | postgres
16384 | test
16390 | test2
17872 | bernd
17873 | foo

$ psql foo
DEBUG: forked new backend, pid=19967 socket=7
FATAL: database "foo" does not exist

$ cat standby/global/pg_database
"template1" 1 1663 666
"template0" 11561 1663 666
"postgres" 11562 1663 666
"test" 16384 1663 666
"test2" 16390 1663 666
"bernd" 17872 1663 666

Obviously, the pg_database file wasn't updated. I've traced through the
recovery process a little bit and i see BuildFlatFile() called during
xact_redo_commit(), however, write_database_file() doesn't write out the
new database records. Funny thing: the same happened to the database
"bernd" before, so it seems to me the new database record is not visible to
write_database_file() during redo?

--
Thanks

Bernd


From: Gianni Ciolli <gianni(dot)ciolli(at)2ndquadrant(dot)it>
To: Bernd Helmle <mailings(at)oopsware(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org, Simon Riggs <simon(at)2ndquadrant(dot)com>
Subject: Re: HotStandby vs. flatfile updates
Date: 2009-02-11 18:48:02
Message-ID: 20090211184802.GA7130@fune
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi Bernd,

On Wed, Feb 11, 2009 at 03:49:24PM +0100, Bernd Helmle wrote:
> I'm currently facing with a strange behavior during HotStandby Testing.
> That's what i'm actually doing:

it seems that this was a known bug ("snapshot bug"), which as noted in

http://wiki.postgresql.org/wiki/Hot_Standby#Resolved_Items.2FIssues

was fixed in version 9h. We actually checked that this particular bug
had been fixed, using the test whose "summary" you can find below.

Probably you are running an old version: it's not your fault, since in
the same page I can read that 9g is the last published version (I know
that Simon is having some difficulties with git).

Thank you for testing,
Dr. Gianni Ciolli - 2ndQuadrant Italia
PostgreSQL Training, Services and Support
gianni(dot)ciolli(at)2ndquadrant(dot)it | www.2ndquadrant.it

---8<------8<------8<------8<------8<------8<------8<------8<------8<---

STANDBY:

try to connect to database "foo" (fails)

PRIMARY:

create database foo

STANDBY:

wait for propagation, then connect to database foo, and issue a simple
query;

PRIMARY;

drop database foo

STANDBY:

wait for propagation, then try connect to database foo (fails)


From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Gianni Ciolli <gianni(dot)ciolli(at)2ndquadrant(dot)it>
Cc: Bernd Helmle <mailings(at)oopsware(dot)de>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: HotStandby vs. flatfile updates
Date: 2009-02-11 19:27:51
Message-ID: 1234380471.4500.980.camel@ebony.2ndQuadrant
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On Wed, 2009-02-11 at 19:48 +0100, Gianni Ciolli wrote:

> Probably you are running an old version: it's not your fault, since in
> the same page I can read that 9g is the last published version (I know
> that Simon is having some difficulties with git).

I did publish v9h to Hackers on 27 Jan, but did not put a new version
onto the Wiki at that time. Sorry Bernd.

I am having a few git issues, so new patch out as soon as I can loosen
the grip of my now favourite repo system.

--
Simon Riggs www.2ndQuadrant.com
PostgreSQL Training, Services and Support


From: Bernd Helmle <mailings(at)oopsware(dot)de>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>, Gianni Ciolli <gianni(dot)ciolli(at)2ndquadrant(dot)it>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: HotStandby vs. flatfile updates
Date: 2009-02-11 19:30:41
Message-ID: E6BCB37A3C2FECA0D5AD6DE6@teje
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

--On Mittwoch, Februar 11, 2009 19:27:51 +0000 Simon Riggs
<simon(at)2ndQuadrant(dot)com> wrote:

> I did publish v9h to Hackers on 27 Jan, but did not put a new version
> onto the Wiki at that time. Sorry Bernd.
>

Great! I just thought its worth reporting it. Sorry for the noise and
missing the new patch version.

> I am having a few git issues, so new patch out as soon as I can loosen
> the grip of my now favourite repo system.

Heh, had my issues here, too ;)

--
Thanks

Bernd