Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bVOVu-0007IP-4H for pgsql-bugs@arkaria.postgresql.org; Thu, 04 Aug 2016 19:41:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bVOVt-0003gE-N7 for pgsql-bugs@arkaria.postgresql.org; Thu, 04 Aug 2016 19:41:05 +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 1bVOVF-0002kG-AB for pgsql-bugs@postgresql.org; Thu, 04 Aug 2016 19:40:25 +0000 Received: from lungold.riddles.org.uk ([82.68.208.19]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bVOVC-0000uA-Hh for pgsql-bugs@postgresql.org; Thu, 04 Aug 2016 19:40:24 +0000 Received: from localhost ([127.0.0.1]:21497 helo=caithnard.riddles.org.uk) by lungold.riddles.org.uk with esmtp (Exim 4.84 (FreeBSD)) (envelope-from ) id 1bVOV8-0001jr-UQ; Thu, 04 Aug 2016 19:40:19 +0000 From: Andrew Gierth To: marko@joh.to Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14279: Logical decoding misses a transaction completely In-Reply-To: <20160804191757.1430.39011@wrigleys.postgresql.org> (marko@joh.to's message of "Thu, 04 Aug 2016 19:17:57 +0000") Message-ID: <8760rgfhrr.fsf@news-spur.riddles.org.uk> References: <20160804191757.1430.39011@wrigleys.postgresql.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) Date: Thu, 04 Aug 2016 20:40:18 +0100 MIME-Version: 1.0 Content-Type: text/plain X-Pg-Spam-Score: -3.1 (---) 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 >>>>> "marko" == marko writes: marko> The problem seems to be that ReorderBufferCommitChild() marko> overwrites the main transaction's base_snapshot with a NULL marko> because it thinks the subtransaction's base_snapshot_lsn=0 is marko> older than the main transaction's actual snapshot i.e. here in ReorderBufferCommitChild: /* * Pass the our base snapshot to the parent transaction if it doesn't have * one, or ours is older. That can happen if there are no changes in the * toplevel transaction but in one of the child transactions. This allows * the parent to simply use it's base snapshot initially. */ if (txn->base_snapshot == NULL || txn->base_snapshot_lsn > subtxn->base_snapshot_lsn) { it's possible for subtxn to exist, but for subtxn->base_snapshot to be NULL and base_snapshot_lsn to be 0, and obviously propagating this to txn is wrong. -- Andrew (irc:RhodiumToad) -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs