Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ihygt-0008E2-UE for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Dec 2019 16:30:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ihygs-000114-Iv for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Dec 2019 16:30:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ihygs-0000w6-2y for pgsql-hackers@lists.postgresql.org; Thu, 19 Dec 2019 16:30:18 +0000 Received: from cyclops.postgrespro.ru ([93.174.131.138] helo=mail.postgrespro.ru) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ihygn-0004fH-GH for pgsql-hackers@postgresql.org; Thu, 19 Dec 2019 16:30:16 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 58D8521C4BEE; Thu, 19 Dec 2019 19:30:11 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from ars-thinkpad (gw.postgrespro.ru [93.174.131.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 1D16E21C4BEB; Thu, 19 Dec 2019 19:30:11 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1576773011; bh=O6HGqCP/p/PeQdPds8Y/nIUdos3tOvuJidogGwCbi4A=; h=References:From:To:Cc:Subject:In-reply-to:Date; b=if3GAyZc0CJ9Un4LHWsvYTE5WGRZhvB94FCX/Az11OF2RFZJ4PqG4tFK3WX0GFxGq WPYqX9qlrZwki2hzWWzFtdgE7Yd0E3XdAcyNOdcHO8jalKaO5Ha17ItRl6kTEzr0ik V8jpWRLNyOF5dTfpUYPLi7EbWt0khUlD5YNWh54s= References: <87tvh9xa0g.fsf@ars-thinkpad> <20190212220022.GA16807@alvherre.pgsql> <87r2c8xocq.fsf@ars-thinkpad> User-agent: mu4e 1.1.0; emacs 26.0.50 From: Arseny Sher To: Alvaro Herrera Cc: pgsql-hackers , Alexander Lakhin Subject: Re: Too rigorous assert in reorderbuffer.c In-reply-to: <87r2c8xocq.fsf@ars-thinkpad> Date: Thu, 19 Dec 2019 19:30:10 +0300 Message-ID: <87lfr8wa5p.fsf@ars-thinkpad> MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Arseny Sher writes: > I'm sorry to bother you with this again, but due to new test our > internal buildfarm revealed that ajacent assert on cmin is also lie. You > see, we can't assume cmin is stable because the same key (relnode, tid) > might refer to completely different tuples if tuple was inserted by > aborted subxact, immeditaly reclaimed and then space occupied by another > one. Fix is attached. > > Technically this might mean a user-facing bug, because we only pick the > first cmin which means we might get visibility wrong, allowing to see > some version too early (i.e real cmin of tuple is y, but decoding thinks > it is x, and x < y). However, I couldn't quickly make up an example > where this would actually lead to bad consequences. I tried to create > such extra visible row in pg_attribute, but that's ok because loop in > RelationBuildTupleDesc spins exactly natts times and ignores what is > left unscanned. It is also ok with pg_class, because apparently > ScanPgRelation also fishes out the (right) first tuple and doesn't check > for duplicates appearing later in the scan. Maybe I just haven't tried > hard enough though. This issue still exists, it would be nice to fix it... -- Arseny Sher Postgres Professional: http://www.postgrespro.com The Russian Postgres Company