On 23/02/2022 23:30, Melanie Plageman wrote:
> I brought this up in [1] but wanted to start a dedicated thread.
>
> Since 16fa9b2b30a357 GiST indexes are not built in shared buffers.
> However, smgrimmedsync() is not done anywhere and skipFsync=true is
> always passed to smgrwrite() and smgrextend(). So, if a checkpoint
> starts and finishes after WAL-logging some of the index build pages and
> there is a crash sometime before the dirty pages make it to permanent
> storage, won't that data be lost?
Yes, good catch!
> Seems like the following would address this:
Committed essentially that, except that I put the smgrimmedsync in a
separate if-block, and copied the comment from the similar piece of code
from nbtsort.c to explain the issue.
Thanks!
- Heikki