pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dang Minh Huong <kakalot49@gmail.com>
To: pgsql-bugs@postgresql.org
Cc: <pgsql-hackers@postgresql.org> <pgsql-hackers@postgresql.org>
Subject: Duplicated row after promote in synchronous streaming replication
Date: Thu, 27 Mar 2014 00:08:11 +0900
Message-ID: <B44DAC9C-FD62-4BD1-88A7-89F184396E99@gmail.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Hi all,

I'm using PostgreSQL 9.1.10 for my HA project and have found this problem.

I did (multiple times) the following sequence in my primary/standby synchronous replication environment,

1. Update rows in a table (which have primary key constraint column) in active DB

2. Stop active DB

3. Promote standby DB

4. Confirm the updated table in promoted standby (new primary) and found that, there's a duplicate updated row (number of row was increased).

I think it is a replication bug but wonder if it was fixed yet. 
Can somebody help me?

I'm not yet confirm PostgreSQL source, but here is my investigation result.

Updated table before promoted were HOT update (index file was not changed).

After promote i continue update that duplicated row (it returned two row updated), and confirm with pg_filedump, i found the duplicated row and only one is related to primary key index constraint.

Compare with old active DB, i saw that after promote line pointer of updated row (duplicated row) is broken into two line pointer, the new one is related to primary index constraint and the other is not related to. Some thing like below, 

Old active DB:
ctid(0,3)->ctid(0,6)->ctid(0,7)

New active DB (after promote and update):
ctid(0,3)->ctid(0,9)
ctid(0,7)->ctid(0,10)

ctid(0,10) is not related to primary key index constraint.

Is something was wrong in redo log in standby DB? Or line pointer in HOT update feature?

Thanks and best regards,
Huong,=

view thread (3+ messages)  latest in thread

Message-ID: <B44DAC9C-FD62-4BD1-88A7-89F184396E99@gmail.com>
Permalink:  ../B44DAC9C-FD62-4BD1-88A7-89F184396E99@gmail.com/
Also on:    postgresql.org/message-id/B44DAC9C-FD62-4BD1-88A7-89F184396E99@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: kakalot49@gmail.com, pgsql-hackers@postgresql.org
  Subject: Re: Duplicated row after promote in synchronous streaming replication
  In-Reply-To: <B44DAC9C-FD62-4BD1-88A7-89F184396E99@gmail.com>
  References: <B44DAC9C-FD62-4BD1-88A7-89F184396E99@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox