Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WSpRL-0002JD-NL for pgsql-bugs@arkaria.postgresql.org; Wed, 26 Mar 2014 15:08:28 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WSpRK-0006BU-Vh for pgsql-bugs@arkaria.postgresql.org; Wed, 26 Mar 2014 15:08:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WSpRJ-0006BJ-QW; Wed, 26 Mar 2014 15:08:26 +0000 Received: from mail-pd0-x22f.google.com ([2607:f8b0:400e:c02::22f]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WSpRC-0007tB-TN; Wed, 26 Mar 2014 15:08:25 +0000 Received: by mail-pd0-f175.google.com with SMTP id x10so2000761pdj.20 for ; Wed, 26 Mar 2014 08:08:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:subject:date:message-id:cc:to:mime-version; bh=hWBB/fYmrCu6vtXWhe+rFtmyhgzBmd1TqqWkVmDNV9E=; b=Miv0qF9hHZYsJq+y8iyNhKVJy7Lll107seQjdtgVNdZmlYJiE1uFqpSChCB7ZDQiQX b6sERDhTCHfBJerPD+2svS+qmeGSkVQkIVDxJ6ykwZLcjPtxvf1kZNGA8OlmroNQCrnZ Mjt0kvdQfoBOiuobGSy5pvZQ6LSY15OCygiqLu8fDt/DgBT6fAxB2Vjr0iWCuCKAK4C4 qjEcuXqJ+gWcqTYxIh9vrgC8TgzPykLAYOEW1WmhzWYm1pAFajSa9y4WxT2Vu/WwUSN4 upefmbe8ObNgJAq59qnecjc09yGdGkgzH4IwwyXC+B9Ra48DbcA/ePFU524zcEFDN1+I a/3w== X-Received: by 10.68.237.38 with SMTP id uz6mr53698332pbc.72.1395846496856; Wed, 26 Mar 2014 08:08:16 -0700 (PDT) Received: from [192.168.0.5] (KD106167179034.ppp-bb.dion.ne.jp. [106.167.179.34]) by mx.google.com with ESMTPSA id x9sm59384777pbu.1.2014.03.26.08.08.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Mar 2014 08:08:15 -0700 (PDT) From: Dang Minh Huong Content-Type: multipart/alternative; boundary="Apple-Mail=_E02BA6B2-4D1B-4D47-9F63-A6F3ED2C6353" Subject: Duplicated row after promote in synchronous streaming replication Date: Thu, 27 Mar 2014 00:08:11 +0900 Message-Id: Cc: "" To: pgsql-bugs@postgresql.org Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) X-Mailer: Apple Mail (2.1874) X-Pg-Spam-Score: -1.7 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --Apple-Mail=_E02BA6B2-4D1B-4D47-9F63-A6F3ED2C6353 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii 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.=20 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,=20 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,= --Apple-Mail=_E02BA6B2-4D1B-4D47-9F63-A6F3ED2C6353 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii
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,
= --Apple-Mail=_E02BA6B2-4D1B-4D47-9F63-A6F3ED2C6353--