Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WSvyY-00031C-Nd for pgsql-bugs@arkaria.postgresql.org; Wed, 26 Mar 2014 22:07:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WSvyY-00044M-05 for pgsql-bugs@arkaria.postgresql.org; Wed, 26 Mar 2014 22:07:10 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WSvyW-00044B-Di; Wed, 26 Mar 2014 22:07:08 +0000 Received: from mail-pa0-x232.google.com ([2607:f8b0:400e:c03::232]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WSvyT-0000XY-6c; Wed, 26 Mar 2014 22:07:07 +0000 Received: by mail-pa0-f50.google.com with SMTP id kq14so2531799pab.37 for ; Wed, 26 Mar 2014 15:07:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=gLnmfXxnNsEhAtrXU09yyw+B7QqgVgMS6k0b+HRmy+w=; b=TXpd/Jbc75yvgafw6Z6kBgJYcbR0MamqzDgFFNLSWfp502bxrtR4a0t3rPA1vpYuAc 0Fx4lVzuSjx7pSanqxTlTuD9hQx2d2etCfRHEpe1B7b77vNAK/YBldoSkY5iBfZwnQ5V SZaBQqXJ+fBWnGcQMalFDVRQv1QgNHFTYODI9zqDp3regRQfn3MJSzvFbZuoY3CTR7NP 2k6JI+iiivirP+w9G31zJHwrOOq43yPfnMGbujGD5d5YnDDOQ6eXpRWXcaKYWyt9wUIm hs2h7K6TnRM1oka56nzl6MdGzcsAenDCc04rRbutPvt4w3ubMMfYoHuJUUysiUD8fijq NHxA== X-Received: by 10.68.240.36 with SMTP id vx4mr26592618pbc.140.1395871623482; Wed, 26 Mar 2014 15:07:03 -0700 (PDT) Received: from [10.37.16.146] (pw126205084066.3.panda-world.ne.jp. [126.205.84.66]) by mx.google.com with ESMTPSA id ky8sm62316412pbc.64.2014.03.26.15.07.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Mar 2014 15:07:01 -0700 (PDT) Content-Type: text/plain; charset=iso-2022-jp Mime-Version: 1.0 (1.0) Subject: Re: [HACKERS] Duplicated row after promote in synchronous streaming replication From: Dang Minh Huong X-Mailer: iPhone Mail (11B651) In-Reply-To: Date: Thu, 27 Mar 2014 07:07:01 +0900 Cc: pgsql-bugs , "" Content-Transfer-Encoding: quoted-printable Message-Id: <70346ADC-37F7-4453-977C-8BF884FD22E5@gmail.com> References: To: Thom Brown X-Pg-Spam-Score: -1.8 (-) 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 2014/03/27 0:18=1B$B!"=1B(BThom Brown =1B$B$N%a%C%;!<%8=1B= (B: >> On 26 March 2014 15:08, Dang Minh Huong wrote: >> Hi all, >>=20 >> I'm using PostgreSQL 9.1.10 for my HA project and have found this proble= m. >>=20 >> I did (multiple times) the following sequence in my primary/standby >> synchronous replication environment, >>=20 >> 1. Update rows in a table (which have primary key constraint column) in >> active DB >>=20 >> 2. Stop active DB >>=20 >> 3. Promote standby DB >>=20 >> 4. Confirm the updated table in promoted standby (new primary) and found >> that, there's a duplicate updated row (number of row was increased). >>=20 >> I think it is a replication bug but wonder if it was fixed yet. >> Can somebody help me? >>=20 >> I'm not yet confirm PostgreSQL source, but here is my investigation resu= lt. >>=20 >> Updated table before promoted were HOT update (index file was not change= d). >>=20 >> After promote i continue update that duplicated row (it returned two row >> updated), and confirm with pg_filedump, i found the duplicated row and o= nly >> one is related to primary key index constraint. >>=20 >> Compare with old active DB, i saw that after promote line pointer of upd= ated >> row (duplicated row) is broken into two line pointer, the new one is rel= ated >> 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) >>=20 >> New active DB (after promote and update): >> ctid(0,3)->ctid(0,9) >> ctid(0,7)->ctid(0,10) >>=20 >> ctid(0,10) is not related to primary key index constraint. >>=20 >> Is something was wrong in redo log in standby DB? Or line pointer in HOT >> update feature? >=20 > It sounds like you're hitting a bug that was introduced in that > exact minor version, and has since been fixed: >=20 > http://www.postgresql.org/docs/9.1/static/release-9-1-11.html >=20 Thanks for your prompt response. I will confirm and revision-up if it is ne= eded. > You should update to the latest minor version, then re-base your > standbys from the primary. >=20 > --=20 > Thom --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs