pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: MauMau <maumau307@gmail.com>
To: Pavan Deolasee <pavan.deolasee@gmail.com>
To: Andres Freund <andres@2ndquadrant.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
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, 13 Aug 2014 21:57:08 +0900
Message-ID: <246F964E3CEB4B8D85FC5876CA37CC36@maumau> (raw)
In-Reply-To: <CABOikdN=3B7zXfOnPTjDzRu6SsuDJsYGE14cu7t2NRv3CffdVw@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>
	<20140618101045.GG3115@awork2.anarazel.de>
	<CABOikdPY9AKdrzsOhfeoOv1xSWNsrZxKWGRthYaFdsxHXjiKfQ@mail.gmail.com>
	<20140618110240.GJ3115@awork2.anarazel.de>
	<11621.1403099146@sss.pgh.pa.us>
	<20140618141949.GC3968@awork2.anarazel.de>
	<CABOikdNMWyfvcm+1Ks-VVRzRDyKsEZj5Ehb3C2+-MYBYftcs+w@mail.gmail.com>
	<CABOikdN=3B7zXfOnPTjDzRu6SsuDJsYGE14cu7t2NRv3CffdVw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

From: "Pavan Deolasee" <pavan.deolasee@gmail.com>
>> Anyone else has an opinion on this?
>>
>>
> Since I did not hear anything on this, I created a patch that adds a new
> flag to tell checkpointer to flush all pages to the disk. Tom (and even I)
> have reservations about the approach, but I would nevertheless leave it to
> the committer to decide. IMV we must fix this bug one way or the other.
> Otherwise users face risk of failing to do clean shutdown.

I'm reviewing this patch.

According to the approach of the patch,  CREATE DATABASE also needs the new 
flag to sync the unlogged tables before copying them from source database to 
the new one.  You need to check other places which do checkpointing.

I'm with Tom-san: I think it would be better for online checkpoints to sync 
unlogged tables without a new flag.  The reasons are:

* There's a greater danger of losing data during operating system restart. 
For example, IIRC, Windows gives only 20 seconds to terminate all services 
during OS shutdown.  If many dirty buffers for unlogged tables linger in the 
shared buffers, PostgreSQL service may fail to complete database shutdown. 
Even if the online checkpoint writes out all dirty buffers, the possibility 
of there being many dirty buffers at shutdown is not zero, but the 
probability would be lower.

* As you missed the CREATE DATABASE case, we may fail to specify the new 
flag when necessary in the future code.

* Unlogged tables are, as its name suggests, for better performance by not 
writing WAL.

* If the online checkpoint leaves dirty buffers, it would be more probable 
that the backends have to write them out when evicting the buffers.  This 
may also indicate some influence on how to interpret pg_stat_bgwriter.

I'm inclined to just make the online checkpoint write out all dirty buffers. 
Could you consider this again?  Let me mark this as waiting on authoer now.

Regards
MauMau



-- 
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: <246F964E3CEB4B8D85FC5876CA37CC36@maumau>
Permalink:  ../246F964E3CEB4B8D85FC5876CA37CC36@maumau/
Also on:    postgresql.org/message-id/246F964E3CEB4B8D85FC5876CA37CC36@maumau

 · 

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: maumau307@gmail.com, pavan.deolasee@gmail.com, andres@2ndquadrant.com, tgl@sss.pgh.pa.us, maxim.boguk@gmail.com
  Subject: Re: BUG #10675: alter database set tablespace and unlogged table
  In-Reply-To: <246F964E3CEB4B8D85FC5876CA37CC36@maumau>
  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> <CABOikdPY9AKdrzsOhfeoOv1xSWNsrZxKWGRthYaFdsxHXjiKfQ@mail.gmail.com> <20140618110240.GJ3115@awork2.anarazel.de> <11621.1403099146@sss.pgh.pa.us> <20140618141949.GC3968@awork2.anarazel.de> <CABOikdNMWyfvcm+1Ks-VVRzRDyKsEZj5Ehb3C2+-MYBYftcs+w@mail.gmail.com> <CABOikdN=3B7zXfOnPTjDzRu6SsuDJsYGE14cu7t2NRv3CffdVw@mail.gmail.com> <246F964E3CEB4B8D85FC5876CA37CC36@maumau>

* 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