data_sync_retry
data_sync_retry
is a configuration parameter determining whether PostgreSQL should issue a PANIC
on failure to flush modified data files to the file system.
data_sync_retry
was added in PostgreSQL 12, and backported to all versions until PostgreSQL 9.4.
Default value
The default value for data_sync_retry
is: off
.
Usage
By default, a PANIC
-level error message will be emitted if it is unable to flush modified data files to the file system. This will result in a PostgreSQL server crash.
If data_sync_retry
is set to on
, there is a risk of data loss because on some operating systems, dirty data cached by the kernel may have been dropped on
write-back failure. A subsequent call to fsync()
may appear to succeed, but not have flushed the data, meaning that a future checkpoint could apparently complete successfully but without actually writing data to disk.
Normally there is no reason to set data_sync_retry
to on
.
Change history
- PostgreSQL 12
- added (commit 9ccdd7f6)
References
- PostgreSQL documentation: data_sync_retry
Useful links
- PostgreSQL scary settings: data_sync_retry - November 2022 blog article by Luca Ferrari