Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bIfGa-0004KY-0L for pgsql-bugs@arkaria.postgresql.org; Thu, 30 Jun 2016 16:56:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bIfGZ-0004Ia-AZ for pgsql-bugs@arkaria.postgresql.org; Thu, 30 Jun 2016 16:56:39 +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 1bIfFv-0003b3-Jy for pgsql-bugs@postgresql.org; Thu, 30 Jun 2016 16:55:59 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bIfFo-0007T9-Km for pgsql-bugs@postgresql.org; Thu, 30 Jun 2016 16:55:58 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 1E13621271; Thu, 30 Jun 2016 12:55:52 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Thu, 30 Jun 2016 12:55:52 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=90Zf/HZp3Q5/HeaRT8jA/t7AjzI=; b=d4IKg qE4tT01/LG9eIhoJcwwNeCYzV/aelY6TMftBqNRYKzlaBNj0brMzECBV0VrptRLs vePRcw5uaT0a3YehWWzLCCHikPHQ/I0U6F91Zquwafor+GqiuALKjK1tjeEKK91z GH2gerB0h6mXjlSnxBYyKO5EVpZaqx5ZlfCErs= X-Sasl-enc: oP5yiOjZeg8l1iFJzKgUAC5mj+QbK3jrzHTf6aFtGjwy 1467305750 Received: from intern.anarazel.de (unknown [192.77.237.104]) by mail.messagingengine.com (Postfix) with ESMTPA id 348CDF2A0A; Thu, 30 Jun 2016 12:55:50 -0400 (EDT) Date: Thu, 30 Jun 2016 09:55:42 -0700 From: Andres Freund To: Tom Lane Cc: petrum@gmail.com, pgsql-bugs@postgresql.org Subject: Re: BUG #14208: Inconsistent code modification - 3 Message-ID: <20160630165542.m2rvs42r3eu3cmlk@alap3.anarazel.de> References: <20160622144830.5791.22512@wrigleys.postgresql.org> <31897.1466610316@sss.pgh.pa.us> <20160623225301.4v7heuiyvkfwi5ev@alap3.anarazel.de> <8242.1467304819@sss.pgh.pa.us> <20160630164712.xliqfdkrb63tumny@alap3.anarazel.de> <8651.1467305511@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8651.1467305511@sss.pgh.pa.us> X-Pg-Spam-Score: -2.6 (--) 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 On 2016-06-30 12:51:51 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2016-06-30 12:40:19 -0400, Tom Lane wrote: > >> Whether or not the toplevel transaction is empty, by the time we get here > >> it would have nentries == nentries_mem, no? > > > Not, if the top-level transaction spilled to disk. > > But doesn't the code stanza just above this loop pull that spillage > back in? Do you mean the following? /* add toplevel transaction if it contains changes */ if (txn->nentries > 0) { ReorderBufferChange *cur_change; if (txn->nentries != txn->nentries_mem) ReorderBufferRestoreChanges(rb, txn, &state->entries[off].fd, &state->entries[off].segno); If so, sure, it pulls changes back in, but only the first static const Size max_changes_in_memory = 4096; ones. We should never reconstruct a whole large transaction in memory... - Andres -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs