Skip to content
Snippets Groups Projects
user avatar
Konstantin Osipov authored
When a new log file is created, replication relay may notice
and try to open it before it has a valid header. In this case
the relase is lead into believing that the log file is corrupt.

When opening a new xlog file, first create the file with .inrpogress
suffix, then write the header, thus get a good file, and only then
rename it to a name without a suffix, so that it's noticeable by
the relay. This prevents sporadic failures of replication with
message "failed to read log file header".

The problem was spotted in Avito after a recent upgrade.
2471aaa2
History
Name Last commit Last update