pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Andres Freund <andres@anarazel.de>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: Haribabu Kommi <kommi.haribabu@gmail.com>
Cc: Thom Brown <thom@linux.com>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] Breakage with VACUUM ANALYSE + partitions
Date: Tue, 12 Apr 2016 09:51:49 +0100 (WEST)
Message-ID: <alpine.DEB.2.10.1604120929180.15815@sto> (raw)
In-Reply-To: <20160411171742.n5xebjt7tcdy4sxf@alap3.anarazel.de>
References: <CAA-aLv6Dp_ZsV-44QA-2zgkqWKQq=GedBX2dRSrWpxqovXK=Pg@mail.gmail.com>
	<CA+TgmoY+jsmZDiRBoNXoYrpM=AkjWx-o_v3pxLo1RPu0JkD17A@mail.gmail.com>
	<CAJrrPGd5ks_r94FEUBs_EA30o5_oVuO6KvOLcVGcigauKKZHdQ@mail.gmail.com>
	<CA+TgmoZiF3_hG8-M6hq_Z-O=VoyNd9FtbmVTw+YcM+Fn-m_rfw@mail.gmail.com>
	<CAB7nPqSBFmh5cQjpRbFBp9Rkv1nF=Nh2o1FxKkJ6yvOBtvYDBA@mail.gmail.com>
	<CA+TgmobDyysoEX0GQVaPwYHk-joMJWyUkpiuyc6w656ewB_Hig@mail.gmail.com>
	<20160326123942.qnuwqg3yg2y7ae4p@alap3.anarazel.de>
	<CA+TgmoYEku8CGaQ7me5+T0Q82jKMrQHPcpOApogag0K2KbiAkQ@mail.gmail.com>
	<20160411165054.r35o4fjicdg4avs7@alap3.anarazel.de>
	<CA+TgmoaX35ui4DVN_74YyxS_gtfMXPo4pkru-AAkBoSCh9FLuA@mail.gmail.com>
	<20160411171742.n5xebjt7tcdy4sxf@alap3.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>


Hello Andres,

> I can think of a number of relatively easy ways to address this:
> 1) Just zap (or issue?) all pending flush requests when getting an
>   smgrinval/smgrclosenode
> 2) Do 1), but filter for the closed relnode
> 3) Actually handle the case of the last open segment not being
>   RELSEG_SIZE properly in _mdfd_getseg() - mdnblocks() does so.
>
> I'm kind of inclined to do both 3) and 1).

Alas I'm a little bit outside my area of expertise. Just for suggestion 
purpose, possibly totally wrong (please accept my apology if this is the 
case), the ideas I had while thinking about these issues, some may be 
quite close to your suggestions above:

  - keep track of file/segment closing/reopenings (say with a counter), so
    that if a flush is about a file/segment which has been closed or
    reopened, it is just skipped. I'm not sure this is enough, because one
    process may do the file cleaning and another may want to flush, although
    I guess there is some kind of locking/shared data structures to manage
    such interactions between pg processes.

  - because of "empty the bucket when filled behavior" of the current
    implementation, a buffer to be flused may be kept for a very
    long time in the bucket. I think that flushing advices become stale
    after a while so should not be issued (the buffer may have been
    written again, ...), or the bucket should be flushed after a while
    even of not full.

Also, a detail in "pg_flush_data", there are a serie of three if/endif, 
but it is not obvious to me whether they are mutually exclusive while 
looking at the source, so I was wondering whether the code could try 
several flushings approaches one after the other... This is probably not 
the case, but I would be more at ease with a if/elif/elif/endif structure 
there so that is clearer.

-- 
Fabien.


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

Message-ID: <alpine.DEB.2.10.1604120929180.15815@sto>
Permalink:  ../alpine.DEB.2.10.1604120929180.15815@sto/
Also on:    postgresql.org/message-id/alpine.DEB.2.10.1604120929180.15815@sto

 · 

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: coelho@cri.ensmp.fr, andres@anarazel.de, robertmhaas@gmail.com, michael.paquier@gmail.com, kommi.haribabu@gmail.com, thom@linux.com, pgsql-hackers@postgresql.org
  Subject: Re: [HACKERS] Breakage with VACUUM ANALYSE + partitions
  In-Reply-To: <alpine.DEB.2.10.1604120929180.15815@sto>
  References: <CAA-aLv6Dp_ZsV-44QA-2zgkqWKQq=GedBX2dRSrWpxqovXK=Pg@mail.gmail.com> <CA+TgmoY+jsmZDiRBoNXoYrpM=AkjWx-o_v3pxLo1RPu0JkD17A@mail.gmail.com> <CAJrrPGd5ks_r94FEUBs_EA30o5_oVuO6KvOLcVGcigauKKZHdQ@mail.gmail.com> <CA+TgmoZiF3_hG8-M6hq_Z-O=VoyNd9FtbmVTw+YcM+Fn-m_rfw@mail.gmail.com> <CAB7nPqSBFmh5cQjpRbFBp9Rkv1nF=Nh2o1FxKkJ6yvOBtvYDBA@mail.gmail.com> <CA+TgmobDyysoEX0GQVaPwYHk-joMJWyUkpiuyc6w656ewB_Hig@mail.gmail.com> <20160326123942.qnuwqg3yg2y7ae4p@alap3.anarazel.de> <CA+TgmoYEku8CGaQ7me5+T0Q82jKMrQHPcpOApogag0K2KbiAkQ@mail.gmail.com> <20160411165054.r35o4fjicdg4avs7@alap3.anarazel.de> <CA+TgmoaX35ui4DVN_74YyxS_gtfMXPo4pkru-AAkBoSCh9FLuA@mail.gmail.com> <20160411171742.n5xebjt7tcdy4sxf@alap3.anarazel.de> <alpine.DEB.2.10.1604120929180.15815@sto>

* 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