Re: avoid multiple hard links to same WAL file after a crash - Mailing list pgsql-hackers

From Greg Stark
Subject Re: avoid multiple hard links to same WAL file after a crash
Date
Msg-id CAM-w4HMOcaApY8qiedkCKRGzfoviLgZrU_Eui=_wM1hV8k=d1Q@mail.gmail.com
Whole thread Raw
In response to Re: avoid multiple hard links to same WAL file after a crash  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: avoid multiple hard links to same WAL file after a crash  (Nathan Bossart <nathandbossart@gmail.com>)
List pgsql-hackers
The readdir interface allows processes to be in the middle of reading
a directory and unless a kernel was happy to either materialize the
entire directory list when the readdir starts, or lock the entire
directory against modification for the entire time the a process has a
readdir fd open it's always going to be possible for the a process to
have previously read the old directory entry and later see the new
directory entry. Kernels don't do any MVCC or cmin type of games so
they're not going to be able to prevent it.

What's worse of course is that it may only happen in very large
directories. Most directories fit on a single block and readdir may
buffer up all the entries a block at a time for efficiency. So it may
only be visible on very large directories that span multiple blocks.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Dump/Restore of non-default PKs
Next
From: "David G. Johnston"
Date:
Subject: Re: Dump/Restore of non-default PKs