A system parameter determining behavior when modified files cannot be flushed

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.


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


Backported feature, Dangerous thing, GUC configuration item

See also