Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fSGuj-0003VF-MC for pgsql-hackers@arkaria.postgresql.org; Mon, 11 Jun 2018 07:06:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fSGui-0006MR-29 for pgsql-hackers@arkaria.postgresql.org; Mon, 11 Jun 2018 07:06:52 +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.89) (envelope-from ) id 1fSGuh-0006MH-MZ for pgsql-hackers@lists.postgresql.org; Mon, 11 Jun 2018 07:06:51 +0000 Received: from mx1.mailbox.org ([80.241.60.212]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fSGua-0000px-6i for pgsql-hackers@postgresql.org; Mon, 11 Jun 2018 07:06:50 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id 8ECA343189; Mon, 11 Jun 2018 09:06:40 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id WMqrHEFI2VDu; Mon, 11 Jun 2018 09:06:39 +0200 (CEST) From: Antonin Houska To: Arseny Sher cc: pgsql-hackers Subject: Re: Fix slot's xmin advancement and subxact's lost snapshots in decoding. In-reply-to: <87lgdyz1wj.fsf@ars-thinkpad> References: <87lgdyz1wj.fsf@ars-thinkpad> Comments: In-reply-to Arseny Sher message dated "Sun, 08 Apr 2018 08:46:04 +0300." MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 11 Jun 2018 09:07:47 +0200 Message-ID: <15387.1528700867@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Arseny Sher wrote: > Please see detailed description of the issues, tests which reproduce > them and fixes in the attached patch. I've played with your tests and gdb for a while, both w/o and with your patch. I think I can understand both problems. I could not invent simpler w= ay to fix them. One comment about the coding: since you introduce a new transaction list and it's sorted by LSN, I think you should make the function AssertTXNLsnOrder() more generic and use it to check the by_base_snapshot_lsn list too. For example call it after the list insertion and deletion in ReorderBufferPassBaseSnapshot(). Also I think it makes no harm if you split the diff into two, although both fixes use the by_base_snapshot_lsn field. --=20 Antonin Houska Cybertec Sch=C3=B6nig & Sch=C3=B6nig GmbH Gr=C3=B6hrm=C3=BChlgasse 26, A-2700 Wiener Neustadt Web: https://www.cybertec-postgresql.com