Streaming replication, some small issues - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Streaming replication, some small issues
Date
Msg-id 4B1E0EC3.8020902@enterprisedb.com
Whole thread Raw
Responses Re: Streaming replication, some small issues  (Fujii Masao <masao.fujii@gmail.com>)
Re: Streaming replication, some small issues  (Greg Stark <gsstark@mit.edu>)
Re: Streaming replication, some small issues  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
A couple of small issues spotted while reviewing the streaming
replication patch:

- Because sentPtr is initialized to zeros, GetOldestWALSendPointer will
return zero before a just-launched WAL sender has sent its first
message. That can lead to WAL files that are still needed by another
standby to be deleted prematurely.

- If a WAL file is not found in the master for some reason, standby goes
into an infinite loop retrying it:

ERROR:  could not read xlog records: FATAL:  could not open file
"pg_xlog/000000010000000000000000" (log file 0, segment 0): No such file
or directory
ERROR:  could not read xlog records: FATAL:  could not open file
"pg_xlog/000000010000000000000000" (log file 0, segment 0): No such file
or directory
ERROR:  could not read xlog records: FATAL:  could not open file
"pg_xlog/000000010000000000000000" (log file 0, segment 0): No such file
or directory

...
- It's possible to shut down master, change max_wal_senders to 0,
restart and do an operation like CLUSTER which then skips WAL-logging.
Then shutdown, change max_wal_senders back to non-zero. All this while
the standby is running. Leads to a corrupt standby.


I've also pushed a couple of small cosmetic changes to replication
branch at git://git.postgresql.org/git/users/heikki/postgres.git

I'll continue reviewing...

--  Heikki Linnakangas EnterpriseDB   http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: marcin mank
Date:
Subject: Re: bug: fuzzystrmatch levenshtein is wrong
Next
From: Zdenek Kotala
Date:
Subject: Re: [patch] executor and slru dtrace probes