Hi, On 2019-05-13 13:21:33 -0400, Alvaro Herrera wrote: > On 2019-May-13, Robert Haas wrote: > > If that's the scenario, I'm not sure the smgrimmedsync() call is > > sufficient. Suppose we log_smgrcreate() but then crash before > > smgrimmedsync()... seems like we'd need to do them in the other order, > > or else maybe just pass a flag to copy_file() telling it not to be so > > picky. > > Well, if we do modify copy_file and thus we don't think the deletion > step serves any purpose, why not just get rid of the deletion step > entirely?
Well, it does serve a purpose: /* * We're in recovery, so unlogged relations may be trashed and must be * reset. This should be done BEFORE allowing Hot Standby * connections, so that read-only backends don't try to read whatever * garbage is left over from before. */ but I'm somewhat doubtful that this logic is correct. Greetings, Andres Freund