Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e26ic-0003nE-CP for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Oct 2017 02:25:58 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1e26ib-0006DR-PP for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Oct 2017 02:25:57 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e26ia-0006Cw-No for pgsql-hackers@postgresql.org; Wed, 11 Oct 2017 02:25:56 +0000 Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1e26iT-0004dO-Sy for pgsql-hackers@postgresql.org; Wed, 11 Oct 2017 02:25:55 +0000 Received: by mail-wm0-x22f.google.com with SMTP id f4so1706374wme.0 for ; Tue, 10 Oct 2017 19:25:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=2mqBHBWRESkGX4Z8DQjLZYpOBFKamtWQu/99SKCtLKU=; b=ETqVQDNTiDZuNxOa4TQQsoL98dzgG19qf9ZDl7NCwuXdoHp+4//gcYIHDBbyL3VaEJ QOEo+tYV3og10xY+l8fKczHjFWhu/KDMe61SpLSk89ckgCxenVR1A06RlKM2qddMYTwo QFIQwUPzOJsSck/hZGNl6NYS3WIeB79IPRn3y8hyEioNmicTB0rE42kbr+cSk0Qq4zdX u3UFJEvbsT8spXBFAAT95A/ieWtk8w6/HwjH5+OSnGiTYiLyWHhtJpFENyEVcrYdsSmP Qyb9n5ivQ8MKi54tZNFmRumAK1ycPecAxpAYO13K2pdvTdFf4n281ckmJ0MFaQQK5IJ2 2cjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=2mqBHBWRESkGX4Z8DQjLZYpOBFKamtWQu/99SKCtLKU=; b=eSeFdXGuwXs0Pw0ZwKj1FiFm1pG1QFxfMDq29FNQL4G3p2RnoasRtw+J6KZ3N6WV/L s3lYHraGafGChKd6riUXaXde3Taxzq6nBfVFojX9RgIYHS5CVxdPYA2NtmEQj+y0Zftl 4pRd5JUlArnebnaAKlOEKGZoFjO0W4/JrOFgWMXoSuPeC+1yeIXRaapszKqLfBm3e4QY p7hl18h55UOkraWJaDknKsg9lSt6ATLkmewnMOB3kJsV7sofekaOGJNoun4fxHh9ZVUR UCgrKp2SaC7y56mRR9ukHL2N4Q2pH1r6gvB47Ml4ybIdqgIEON3cOr86frvHItcQVbeP qomA== X-Gm-Message-State: AMCzsaViVxhKrz1q7cp7Eta7SWuNN5l4lCO72Q5zBx9+ivjDkgbkhUUa Glnn20D5ZxWyT6acAh7ibZ78RYyGqeEZet0bbXo= X-Google-Smtp-Source: AOwi7QBnXurl3LVzMAG2+KIMqsCDpUWal47OjCP4/SsFnhThGtmJcTQC3mSadBzR5h4cPhzQUlladtMYpvG9B8uBisU= X-Received: by 10.28.173.131 with SMTP id w125mr14453974wme.126.1507688747526; Tue, 10 Oct 2017 19:25:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.188.2 with HTTP; Tue, 10 Oct 2017 19:25:46 -0700 (PDT) In-Reply-To: <20171010141444.s5tadnstsednska6@alvherre.pgsql> References: <835EB743-A57A-49AE-ADA7-A16ACCB737D7@amazon.com> <20171010141444.s5tadnstsednska6@alvherre.pgsql> From: Michael Paquier Date: Wed, 11 Oct 2017 11:25:46 +0900 Message-ID: Subject: Re: [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple To: Alvaro Herrera Cc: "Wood, Dan" , Peter Geoghegan , "Wong, Yi Wen" , PostgreSQL Hackers , Robert Haas Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On Tue, Oct 10, 2017 at 11:14 PM, Alvaro Herrera wrote: > I was seeing just the reindex problem. I don't see any more dups. > > But I've tried to reproduce it afresh now, and let it run for a long > time and nothing happened. Maybe I made a mistake last week and > ran an unfixed version. I don't see any more problems now. Okay, so that's one person more going to this trend, making three with Peter and I. >> If you are getting the dup rows consider the code in the block in >> heapam.c that starts with the comment =E2=80=9Creplace multi by update x= id=E2=80=9D. >> >> When I repro this I find that MultiXactIdGetUpdateXid() returns 0. >> There is an updater in the multixact array however the status is >> MultiXactStatusForNoKeyUpdate and not MultiXactStatusNoKeyUpdate. I >> assume this is a preliminary status before the following row in the >> hot chain has it=E2=80=99s multixact set to NoKeyUpdate. > > Yes, the "For" version is the locker version rather than the actual > update. That lock is acquired by EvalPlanQual locking the row just > before doing the update. I think GetUpdateXid has no reason to return > such an Xid, since it's not an update. > >> Since a 0 is returned this does precede cutoff_xid and >> TransactionIdDidCommit(0) will return false. This ends up aborting >> the multixact on the row even though the real xid is committed. This >> sets XMAX to 0 and that row becomes visible as one of the dups. >> Interestingly the real xid of the updater is 122944 and the cutoff_xid >> is 122945. > > I haven't seen this effect. Please keep us updated if you're able to > verify corruption this way. Me neither. It would be nice to not live long with such a sword of Damocles. --=20 Michael --=20 Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers