On Wed, Oct 19, 2011 at 2:31 AM, Fujii Masao <masao.fujii@gmail.com> wrote:
>> My reading of the situation is that you're talking about a problem
>> that will only occur if, while the master is in the process of
>> shutting down, a network error occurs.
>
> No. This happens even if a network error doesn't occur. I can
> reproduce the issue by doing the following:
>
> 1. Set up streaming replication master and standby with archive
> setting.
> 2. Run pgbench -i
> 3. Shuts down the master with fast mode.
>
> Then I can see that the latest WAL file in the master's pg_xlog
> doesn't exist in the standby's one. The WAL record which was
> lost was the shutdown checkpoint one.
>
> When smart or fast shutdown is requested, the master tries to
> write and send the WAL switch (if archiving is enabled) and
> shutdown checkpoint record. Because of the problem I described,
> the WAL switch record arrives at the standby but the shutdown
> checkpoint does not.
Oh, that's not good.
> The original behavior, in 9.0, is that all outstanding WAL are
> replicated to the standby when the master shuts down normally.
> But ISTM the behavior was changed unexpectedly in 9.1. So
> I think that it should be back-patched to 9.1 to revert the behavior
> to the original.
Which commit broke this?
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company