pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Peter Geoghegan <pg@heroku.com>
Cc: Noah Misch <noah@leadboat.com>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Andres Freund <andres@anarazel.de>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: Magnus Hagander <magnus@hagander.net>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Cc: pgsql-core <pgsql-core@postgresql.org>
Subject: Re: Restore-reliability mode
Date: Thu, 23 Jul 2015 16:53:49 -0300
Message-ID: <20150723195349.GW5596@postgresql.org> (raw )
In-Reply-To: <CAM3SWZT9tHNDj4Q0-=tcYiEtBHZteCF-=0_B=LddQ18c8qA1wQ@mail.gmail.com >
References: <CA+TgmoYSO0a9YDe2bhpZoPgO4m62CyQL26LRkCQ8=vrQ8ZwdXA@mail.gmail.com >
<12510.1432958887@sss.pgh.pa.us >
<CA+TgmoYovkev0xXnxaTD8vnt=M9Cn+RmOkVEouqwj6_9JLkzLw@mail.gmail.com >
<20150530154559.GA25053@momjian.us >
<20150530204727.GJ13944@alap3.anarazel.de >
<20150531024845.GB13697@momjian.us >
<20150603135049.GA74753@tornado.leadboat.com >
<CANP8+jJgKpBac77b77xLWTxxBeq9hG3a0uY-JUv6F4k=2=Nsgw@mail.gmail.com >
<20150606195805.GA118899@tornado.leadboat.com >
<CAM3SWZT9tHNDj4Q0-=tcYiEtBHZteCF-=0_B=LddQ18c8qA1wQ@mail.gmail.com >
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Peter Geoghegan wrote:
> On Sat, Jun 6, 2015 at 12:58 PM, Noah Misch <noah@leadboat.com> wrote:
> > - Call VALGRIND_MAKE_MEM_NOACCESS() on a shared buffer when its local pin
> > count falls to zero. Under CLOBBER_FREED_MEMORY, wipe a shared buffer
> > when its global pin count falls to zero.
>
> Did a patch for this ever materialize?
I think the first part would be something like the attached.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Attachments:
0001-add-valgrind-calls.patch (text/x-diff, 1.2K) download
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index e4b25587..83fde10 100644
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -47,6 +47,7 @@
#include "storage/proc.h"
#include "storage/smgr.h"
#include "storage/standby.h"
+#include "utils/memdebug.h"
#include "utils/rel.h"
#include "utils/resowner_private.h"
#include "utils/timestamp.h"
@@ -1438,6 +1439,9 @@ PinBuffer(volatile BufferDesc *buf, BufferAccessStrategy strategy)
ref = NewPrivateRefCountEntry(b + 1);
LockBufHdr(buf);
+
+ VALGRIND_MAKE_MEM_DEFINED(BufHdrGetBlock(buf), BLCKSZ);
+
buf->refcount++;
if (strategy == NULL)
{
@@ -1498,6 +1502,8 @@ PinBuffer_Locked(volatile BufferDesc *buf)
*/
Assert(GetPrivateRefCountEntry(b + 1, false) == NULL);
+ VALGRIND_MAKE_MEM_DEFINED(BufHdrGetBlock(buf), BLCKSZ);
+
buf->refcount++;
UnlockBufHdr(buf);
@@ -1543,6 +1549,8 @@ UnpinBuffer(volatile BufferDesc *buf, bool fixOwner)
Assert(buf->refcount > 0);
buf->refcount--;
+ VALGRIND_MAKE_MEM_NOACCESS(BufHdrGetBlock(buf), BLCKSZ);
+
/* Support LockBufferForCleanup() */
if ((buf->flags & BM_PIN_COUNT_WAITER) &&
buf->refcount == 1)
view thread (79+ messages) latest in thread
Message-ID: <20150723195349.GW5596@postgresql.org>
Permalink: ../20150723195349.GW5596@postgresql.org/
Also on: postgresql.org/message-id/20150723195349.GW5596@postgresql.org
copy link · copy postgr.es · copy git am
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: alvherre@2ndquadrant.com, pg@heroku.com, noah@leadboat.com, simon@2ndquadrant.com, bruce@momjian.us, andres@anarazel.de, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, sfrost@snowman.net, magnus@hagander.net, pgsql-core@postgresql.org
Subject: Re: Restore-reliability mode
In-Reply-To: <20150723195349.GW5596@postgresql.org>
* 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