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 | template111561 | template011562 | postgres16384 | test16390 | test217872 | bernd17873 | 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