Re: Block write statistics WIP

From: Greg Smith <greg(at)2ndQuadrant(dot)com>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Block write statistics WIP
Date: 2013-05-23 23:10:44
Message-ID: 519EA1F4.4080809@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 5/20/13 7:51 AM, Heikki Linnakangas wrote:
>> The way that MarkDirty requires this specific underlying storage manager
>> behavior to work properly strikes me as as a bit of a layering violation
>> too. I'd like the read and write paths to have a similar API, but here
>> they don't even operate on the same type of inputs. Addressing that is
>> probably harder than just throwing a hack on the existing code though.
>
> To be honest, I don't understand what you mean by that. ?

Let's say you were designing a storage layer API from scratch for what
Postgres does. That might take a relation as its input, like ReadBuffer
does. Hiding the details of how that turns into a physical file
operation would be a useful goal of such a layer. I'd then consider it
a problem if that exposed things like the actual mapping of relations
into files to callers.

What we actually have right now is this MarkDirty function that operates
on BufferTag data, which points directly to the underlying file. I see
that as cutting the storage API in half and calling a function in the
middle of the implementation. It strikes me as kind of weird that the
read side and write side are not more symmetrical.

--
Greg Smith 2ndQuadrant US greg(at)2ndQuadrant(dot)com Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robins Tharakan 2013-05-23 23:19:36 Add tests for LOCK TABLE
Previous Message Michael Paquier 2013-05-23 22:55:26 Re: WARNING : pgstat wait timeout - Postgres 9.1