Re: pageinspect option to forgo buffer locking?

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pageinspect option to forgo buffer locking?
Date: 2017-11-09 17:55:30
Message-ID: CA+Tgmob1owVMYOD=YdnCrqwYzM_skiU-_YK+ECK-PwRZJq-MFw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 9, 2017 at 12:49 PM, Andres Freund <andres(at)anarazel(dot)de> wrote:
> Occasionally, when debugging issues, I find it quite useful to be able
> to do a heap_page_items() on a page that's actually locked exclusively
> concurrently. E.g. investigating the recent multixact vacuuming issues,
> it was very useful to attach a debugger to one backend to step through
> freezing, and display the page in another session.
>
> Currently the locking in get_raw_page_internal() prevents that. If it's
> an option defaulting to off, I don't see why we couldn't allow that to
> skip locking the page's contents. Obviously you can get corrupted
> contents that way, but we already allow to pass arbitrary stuff to
> heap_page_items(). Since pinning wouldn't be changed, there's no danger
> of the page being moved out from under us.

heap_page_items() is, if I remember correctly, not necessarily going
to tolerate malformed input very well - I think that's why we restrict
all of these functions to superusers. So using it in this way would
seem to increase the risk of a server crash or other horrible
misbehavior. Of course if we're just dev-testing that doesn't really
matter.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-11-09 17:56:49 Re: Simplify ACL handling for large objects and removal of superuser() checks
Previous Message Joe Conway 2017-11-09 17:53:17 Re: libpq connection strings: control over the cipher suites?