Re:PostgreSQL used fsync incorrectly for 20 years
by jeffdavis on Sunday February 10, 2019 @11:31AM
(#19128410)
Everyone in that thread knows what a partial write is. That's why the patch author saw this error message:
> 2011-07-31 22:13:35 EST postgres postgres [local] LOG: connection authorized: user=postgres database=postgres
> 2011-07-31 22:13:35 EST ERROR: could not write block 1 of relation global/2671: wrote only 4096 of 8192 bytes
> 2011-07-31 22:13:35 EST HINT: Check free disk space.
> 2011-07-31 22:13:35 EST CONTEXT: writing block 1 of relation global/2671
> 2011-07-31 22:13:35 EST [unknown] [unknown] LOG: connection received: host=[local]
If they didn't know what a partial write was, they wouldn't have identified it specifically as an error case with its own informative error message.The proposed patch retries rather than throwing an error.
It's a pity a lot developers out there do not have an ingrained awareness about this.