Re: small smgrcreate cleanup patch

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: small smgrcreate cleanup patch
Date: 2010-08-20 03:35:06
Message-ID: 6636.1282275306@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> So I propose moving the TablespaceCreateDbspace() call to mdcreate(),
> removing the redundant check from smgrcreate(), and deleting that
> portion of the comment which says this is in the wrong place.

While I don't care for having smgr.c call tablespace.c, moving the call to
md.c instead is surely not an improvement :-(. The problem here is that
we'd like the tablespace code to be above the smgr code, not below.
Calling it from md.c makes the layer inversion worse not better.

> You could argue that perhaps md.c isn't the right place either, but it
> certainly makes more sense than smgr.c, and I'd argue it's exactly
> right.

On what grounds pray tell?

> A related, interesting question is whether there's any purpose to the
> smgr layer at all.

Not a lot anymore, I think. This has been ranted about before, but
I think the Berkeley guys bet on the wrong horse when they put an API
layer here. The facilities that might once have been usefully switched
between at this level are now all down inside kernel device drivers.
I could see merging smgr.c and md.c entirely. But they'd still be
appropriately placed below, not above, the tablespace commands.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message tomas 2010-08-20 06:54:38 Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!
Previous Message KaiGai Kohei 2010-08-20 03:07:30 Re: security hook on authorization