Re: [PATCH] lazy relations delete - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: [PATCH] lazy relations delete
Date
Msg-id CA+hUKGKXm3jX-Wi0f2dMDGnNURp=9z+iOs9bQ+XypAnUyrENYQ@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] lazy relations delete  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
List pgsql-hackers
On Wed, Jan 8, 2020 at 5:20 PM Kyotaro Horiguchi
<horikyota.ntt@gmail.com> wrote:
> Relfilenode can be reused right after commit. There can be a case
> where readers of the resued relfilenode see the pages from already
> removed files left on shared buffers. On the other hand newly
> allocated buffers for the reused relfilenode are not flushed out until
> the lazy invalidate machinery actually frees the "garbage" buffers and
> it leads to a broken database after a crash.  But finally the
> machinery trashes away the buffers involving the correct ones at
> execution time.

The relfilenode can't be reused until the next checkpoint, can it?
The truncated file remains in the file system, specifically to prevent
anyone from reusing the relfilenode.  See the comment for mdunlink().
There may be other problems with the idea, but wouldn't the zombie
buffers be harmless, if they are invalidated before
SyncPostCheckpoint() unlinks the underlying files (and you never try
to flush them)?



pgsql-hackers by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: [PATCH] lazy relations delete
Next
From: Masahiko Sawada
Date:
Subject: Re: parallel vacuum options/syntax