Re: Sync Rep: First Thoughts on Code

From: "Fujii Masao" <masao(dot)fujii(at)gmail(dot)com>
To: "Simon Riggs" <simon(at)2ndquadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Sync Rep: First Thoughts on Code
Date: 2008-12-05 08:12:46
Message-ID: 3f0b79eb0812050012g6cdb63d3yeb8d84e1c3f70d02@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi, sorry for my consecutive posting.

On Fri, Dec 5, 2008 at 4:00 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> Hello,
>
> On Fri, Dec 5, 2008 at 12:09 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>>> I was expecting you to have walreceiver and startup share an end of WAL
>>> address via shared memory, so that startup never tries to read past end.
>>> That way we would be able to begin reading a WAL file *before* it was
>>> filled. Waiting until a file fills means we still have to have
>>> archive_timeout set to ensure we switch regularly.
>>
>> You mean that not pg_standby but startup process waits for the next
>> WAL available? If so, I agree with you in the future. That is, I just think
>> that this is next TODO because there are many problems which we
>> should resolve carefully to achieve it. But, if it's essential for 8.4, I will
>> tackle it. What is your opinion? I'd like to clear up the goal for 8.4.
>
> Umm.. on second thought, this feature (continuous recovery without
> pg_standby) seems to be essential for 8.4. So, I will try it.
>
> Development plan:
> - Share the end of WAL address via shared memory <--- Done!
> - Change ReadRecord() to wait for the next WAL *record* available.
> - Change ReadRecord() to restore the WAL from archive by using
> pg_standby before reaching the replication starting position, then
> read the half-streaming WAL from pg_xlog.
> - Add new trigger for promoting the standby to the primary. As the
> trigger, when fast shudown (SIGINT) is requested during recovery,
> the standby would recover the WAL up to end and become the
> primary.
>
> What system call does walreceiver have to call against the WAL
> before startup process reads it? Probably we need to call write(2),
> and don't need fsync(2) in Linux. How about other platform?

I added the figures about the latest architecture into PDF file.
Please check P6, 7. Is this architecture close to your imege?
http://wiki.postgresql.org/wiki/NTT%27s_Development_Projects#Detailed_Design

Regards,

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Smith 2008-12-05 08:26:47 Re: [patch] pg_upgrade script for 8.3->8.4
Previous Message Greg Smith 2008-12-05 07:47:30 Re: In-place upgrade: catalog side