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.
Loading
Please register or sign in to comment