RE: archive status ".ready" files may be created too early

Ryo Matsumura (Fujitsu) <matsumura.ryo@fujitsu.com>

From: "matsumura.ryo@fujitsu.com" <matsumura.ryo@fujitsu.com>
To: 'Kyotaro Horiguchi' <horikyota.ntt@gmail.com>
Cc: "bossartn@amazon.com" <bossartn@amazon.com>, "masao.fujii@gmail.com" <masao.fujii@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2020-07-22T02:53:49Z
Lists: pgsql-hackers
Hello,

> At Mon, 13 Jul 2020 01:57:36 +0000, "Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>" wrote in
> Am I missing something here?

I write more detail(*).

  Record-A and Record-B are cross segment-border records.
  Record-A spans segment X and X+1.
  Record-B spans segment X+2 and X+3.
  If both records have been inserted to WAL buffer, lastSegContRecStart/End points to Record-B
* If a writer flushes segment X and a part of X+1 but record-A is not flushed completely,
  NotifyStableSegments() allows the writer to notify segment-X.

Then, Record-A may be invalidated by crash-recovery and overwritten by new WAL record.
The segment-X is not same as the archived one.

Regard
Ryo Matsumura