pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: Peter Geoghegan <pg@bowt.ie>
Cc: Ronan Dunklau <ronan.dunklau@aiven.io>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Subject: Re: FSM Corruption (was: Could not read block at end of the relation)
Date: Thu, 11 Apr 2024 19:27:08 -0700
Message-ID: <20240412022708.d6@rfd.leadboat.com> (raw)
In-Reply-To: <CAH2-Wzm8tWR8fEgPTQ+BB-Wqt+efHso-vNfmCKr06ZmiLpjbNQ@mail.gmail.com>
References: <VtPLBUerbMM8BSDLQwIMV9Co_38iHS1TXE4V09x2ZVFhPkZMNE8LwgPSIzB8PHkVFXykGx04QNAzZVjJFAnU1w==@protonmail.internalid>
	<1970118.yKVeVyVuyW@aivenlaptop>
	<20240312220807.05.nmisch@google.com>
	<3225659.5fSG56mABF@aivenlaptop>
	<20240313165523.6a@rfd.leadboat.com>
	<CAH2-Wzm8tWR8fEgPTQ+BB-Wqt+efHso-vNfmCKr06ZmiLpjbNQ@mail.gmail.com>

On Thu, Apr 11, 2024 at 12:01:09PM -0400, Peter Geoghegan wrote:
> On Wed, Mar 13, 2024 at 12:55 PM Noah Misch <noah@leadboat.com> wrote:
> > That's a reasonable thing to worry about.  We could do wrong by trying too
> > hard to use an FSM slot, and we could do wrong by not trying hard enough.
> 
> Although it's not related to the problem you're working on, it seems
> like a good opportunity to bring up a concern about the FSM that I
> don't believe was discussed at any point in the past few years: I
> wonder if the way that fsm_search_avail() sometimes updates
> fsmpage->fp_next_slot with only a shared lock on the page could cause
> problems. At the very least, it's weird that we allow it.

fsm_search_avail() treats an out-of-range fp_next_slot like zero, so I'm not
seeing a correctness issue.  I bet changing it under an exclusive lock
wouldn't deliver better-optimized searches to an extent that pays for the
synchronization overhead, but it might.





view thread (32+ messages)  latest in thread

Message-ID: <20240412022708.d6@rfd.leadboat.com>
Permalink:  ../20240412022708.d6@rfd.leadboat.com/
Also on:    postgresql.org/message-id/20240412022708.d6@rfd.leadboat.com

 · 

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-bugs@postgresql.org
  Cc: noah@leadboat.com, pg@bowt.ie, ronan.dunklau@aiven.io, michael@paquier.xyz, pgsql-bugs@lists.postgresql.org
  Subject: Re: FSM Corruption (was: Could not read block at end of the relation)
  In-Reply-To: <20240412022708.d6@rfd.leadboat.com>

* 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