pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@2ndquadrant.com>
To: Pavan Deolasee <pavan.deolasee@gmail.com>
Cc: maxim.boguk <maxim.boguk@gmail.com>
Cc: Pg Bugs <pgsql-bugs@postgresql.org>
Subject: Re: BUG #10675: alter database set tablespace and unlogged table
Date: Wed, 18 Jun 2014 12:10:45 +0200
Message-ID: <20140618101045.GG3115@awork2.anarazel.de> (raw)
In-Reply-To: <CABOikdPiDnBsAvdxo-wE6hY=UPUQPKQTRK5Cg=h0caMDgdxM+A@mail.gmail.com>
References: <20140617032438.2585.42918@wrigleys.postgresql.org>
	<CABOikdMxX0VdJEKSBd62sX_XAwa_=MAFqdAXXbU5V+BHZOxrng@mail.gmail.com>
	<CABOikdPiDnBsAvdxo-wE6hY=UPUQPKQTRK5Cg=h0caMDgdxM+A@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 2014-06-18 15:33:58 +0530, Pavan Deolasee wrote:
> On Wed, Jun 18, 2014 at 12:31 PM, Pavan Deolasee <pavan.deolasee@gmail.com>
> wrote:
> 
> >
> >  Attached patch fixes this for the HEAD. But this needs to be fixed all
> >> the way to 9.1 when unlogged tables were first introduced.
> >>
> >
> >
> I'd forgotten to update the comment in the code. Fixed in the attached
> version.
> 
> Thanks,
> Pavan
> 
> -- 
> Pavan Deolasee
> http://www.linkedin.com/in/pavandeolasee

> diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
> index c070278..e0b9aff 100644
> --- a/src/backend/storage/buffer/bufmgr.c
> +++ b/src/backend/storage/buffer/bufmgr.c
> @@ -1221,11 +1221,12 @@ BufferSync(int flags)
>  	ResourceOwnerEnlargeBuffers(CurrentResourceOwner);
>  
>  	/*
> -	 * Unless this is a shutdown checkpoint, we write only permanent, dirty
> -	 * buffers.  But at shutdown or end of recovery, we write all dirty
> -	 * buffers.
> +	 * If a force checkpoint or at shutdown or end of recovery, we write all
> +	 * dirty buffers, otherwise we only write permanent buffers
>  	 */
> -	if (!((flags & CHECKPOINT_IS_SHUTDOWN) || (flags & CHECKPOINT_END_OF_RECOVERY)))
> +	if (!((flags & CHECKPOINT_IS_SHUTDOWN) ||
> +		  (flags & CHECKPOINT_END_OF_RECOVERY) ||
> +		  (flags & CHECKPOINT_FORCE)))
>  		mask |= BM_PERMANENT;

Won't that significantly regress manually issued CHECKPOINT;s?

Greetings,

Andres Freund

-- 
 Andres Freund	                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


-- 
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 (35+ messages)  latest in thread

Message-ID: <20140618101045.GG3115@awork2.anarazel.de>
Permalink:  ../20140618101045.GG3115@awork2.anarazel.de/
Also on:    postgresql.org/message-id/20140618101045.GG3115@awork2.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@2ndquadrant.com, pavan.deolasee@gmail.com, maxim.boguk@gmail.com
  Subject: Re: BUG #10675: alter database set tablespace and unlogged table
  In-Reply-To: <20140618101045.GG3115@awork2.anarazel.de>
  References: <20140617032438.2585.42918@wrigleys.postgresql.org> <CABOikdMxX0VdJEKSBd62sX_XAwa_=MAFqdAXXbU5V+BHZOxrng@mail.gmail.com> <CABOikdPiDnBsAvdxo-wE6hY=UPUQPKQTRK5Cg=h0caMDgdxM+A@mail.gmail.com> <20140618101045.GG3115@awork2.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