Hi Tomas,
I did not find a problem. Everything looks correct.
Two small things
1. There is no test for skip_fpi, so I attached a small TAP test.
2. XLogPrefetcherAddFPI() is called when has_image is
set. Maybe call it when this is true instead:
block->apply_image || (block->flags & BKPBLOCK_WILL_INIT)
Redo does not read the page in either case.
Thanks,
Shihao