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

From Fujii Masao
Subject Re: Streaming replication, some small issues
Date
Msg-id 3f0b79eb0912081701t4adbde40s4aa63b1f0df60196@mail.gmail.com
Whole thread Raw
In response to Re: Streaming replication, some small issues  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Streaming replication, some small issues  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Tue, Dec 8, 2009 at 9:05 PM, Heikki Linnakangas
<heikki.linnakangas@enterprisedb.com> wrote:
>> I suspect we should have a WAL record to say "unlogged operation
>> performed here" which a standby database would recognize and throw a
>> large warning up.
>
> +1. Seems like a very simple solution.

Sounds good. This is not just a problem of SR, so I'll implement it
as self-contained feature later.

Design:
- If relation is not temp and archiving (and streaming replication) is enabled, we log the "unlogged OP" record
includingrelfilenode of the relation.
 

- If "unlogged OP" record is found during archive recovery, we register its relfilenode to the hashtable which tracks
maybecorrupted relations. If the registered relfilenode is brandnew, we emit warning. Also, the log record indicating
"DROPTABLE" etc is found, we remove its relfilenode from the hashtable.
 

- When restartpoint occurs, we write all the registered relfilenodes to the flat file.

- At the end of archive recovery, if there is relfilenode in the hashtable, we emit FATAL error to prevent the server
frombeing brought up. XXX: But this might be too conservative. I believe that some people want to complete archive
recoveryeven if a relation is corrupted, and drop that relation after the server has been activated. So I'm going to
providenew recovery.conf parameter specifying whether to let archive recovery fail when some relations might be
corrupted.

Thought? Am I missing something?

Regards,

-- 
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Adding support for SE-Linux security
Next
From: Tom Lane
Date:
Subject: Re: Streaming replication, some small issues