Re: mdnblocks() sabotages error checking in _mdfd_getseg() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: mdnblocks() sabotages error checking in _mdfd_getseg()
Date
Msg-id 1779.1449773289@sss.pgh.pa.us
Whole thread Raw
In response to Re: mdnblocks() sabotages error checking in _mdfd_getseg()  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: mdnblocks() sabotages error checking in _mdfd_getseg()  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Thu, Dec 10, 2015 at 1:22 PM, Simon Riggs <simon@2ndquadrant.com> wrote:
>> We can seq scan the array at relcache build time and invalidate relcache
>> when we extend. WAL log any extension to a new segment and write the table
>> to disk at checkpoint.

> Invaliding the relcache when we extend would be extremely expensive,

... and I think it would be too late anyway, if backends are relying on
the relcache to tell the truth.  You can't require an exclusive lock on
a rel just to extend it, which means there cannot be a guarantee that
what a backend has in its relcache will be up to date with current reality.

I really don't like Robert's proposal of a metapage though.  We've got too
darn many forks per relation already.

It strikes me that this discussion is perhaps conflating two different
issues.  Robert seems to be concerned about how we'd detect (not recover
from, just detect) filesystem misfeasance in the form of complete loss
of a non-last segment file.  The other issue is a desire to reduce the
cost of mdnblocks() calls.  It may be worth thinking about those two
things together, but we shouldn't lose sight of these being separate
goals, assuming that anybody besides Robert thinks that the segment
file loss issue is worth worrying about.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: proposal: PL/Pythonu - function ereport
Next
From: Robert Haas
Date:
Subject: Re: Inaccurate results from numeric ln(), log(), exp() and pow()