September 25, 2022

Can block write be considered as atomic if it's size fits to the file system block size

Rishat Zakirov

Short Answer: Yes

In most modern file systems where techniques like journaling or copy-on-write is used, the write operation of block is atomic.

In Postgres documentation it is mentioned that there is no partial-write problem when they write pg_control, because it is smaller than one disk page.

Anyway, it is rare that one block write is enough. But it can be extermely important if you rely on this feature as a "commit" operation in techniques such as "Shadow Paging".