pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: petrum@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14208: Inconsistent code modification - 3
Date: Thu, 30 Jun 2016 09:55:42 -0700
Message-ID: <20160630165542.m2rvs42r3eu3cmlk@alap3.anarazel.de> (raw)
In-Reply-To: <8651.1467305511@sss.pgh.pa.us>
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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 2016-06-30 12:51:51 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> 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



view thread (10+ messages)  latest in thread

Message-ID: <20160630165542.m2rvs42r3eu3cmlk@alap3.anarazel.de>
Permalink:  ../20160630165542.m2rvs42r3eu3cmlk@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20160630165542.m2rvs42r3eu3cmlk@alap3.anarazel.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: andres@anarazel.de, tgl@sss.pgh.pa.us, petrum@gmail.com
  Subject: Re: BUG #14208: Inconsistent code modification - 3
  In-Reply-To: <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> <20160630165542.m2rvs42r3eu3cmlk@alap3.anarazel.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox