Skip to content
Snippets Groups Projects
Commit 2471aaa2 authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

Make sure replica doesn't stop if reads a new xlog file with partial header

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.
parent 5727035c
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment