BUG #8364: BUG: Patch for fail-back without fresh backup

From: digoal(at)126(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #8364: BUG: Patch for fail-back without fresh backup
Date: 2013-08-06 02:31:41
Message-ID: E1V6X3l-0007kx-1U@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 8364
Logged by: digoal.zhou
Email address: digoal(at)126(dot)com
PostgreSQL version: Unsupported/Unknown
Operating system: CentOS 5.8 x64
Description:

When i use failback_safe_standby_v4.patch patch the postgresql 9.4 devel
http://git.postgresql.org/gitweb/?p=postgresql.git;a=snapshot;h=e5592c61adb0766eaee53ec07d2f05783d1c6548;sf=tgz
.patch success. but test in async replicatoin environment fail-back not
success.
detail below:
1. primary config
wal_level = hot_standby
synchronous_commit = remote_write
synchronous_transfer=data_flush # or all, but fail-back also not success.
2. standby config

3. test sql
digoal=# create table test (id int primary key, info text, crt_time
timestamp);
CREATE TABLE
digoal=# create or replace function func() returns void as $$
digoal$# declare
digoal$# v_id int;
digoal$# begin
digoal$# v_id := round(5000000*random());
digoal$# update test set
info=md5(random()::text),crt_time=clock_timestamp() where id=v_id;
digoal$# if found then
digoal$# return;
digoal$# else
digoal$# insert into test values
(v_id,md5(random()::text),clock_timestamp());
digoal$# end if;
digoal$# return;
digoal$# end;
digoal$# $$ language plpgsql strict;
CREATE FUNCTION
4. pgbench running
pgbench -M prepared -f ./test.sql -r -n -h $PGDATA -p 2999 -U postgres -c 16
-j 4 -T 100 digoal
5. checkpoint on master success

6. shutdown or promote standby
success
7. pgbench stop

8. shutdown master, and fail-back to standby, but not success.
log below.
2013-08-06 09:39:53.650 CST,,,13339,,520053e9.341b,2,,2013-08-06 09:39:53
CST,,0,FATAL,XX000,"could not receive data from WAL stream: ERROR:
requested starting point 0/52000000 is ahead of the WAL flush position of
this server 0/45AD6088
",,,,,,,,"libpqrcv_receive, libpqwalreceiver.c:513",""

# ### but i can success fail-back when use sync replication and this patch.
detail info at my blog:
http://blog.163.com/digoal(at)126/blog/static/16387704020137551911457

Browse pgsql-bugs by date

  From Date Subject
Next Message bughunt 2013-08-06 08:31:40 BUG #8365: Two documentation suggestions
Previous Message Greg Stark 2013-08-05 18:02:24 Re: BUG #8362: postres webserver