"My problem is that sometimes WAL uploaded from master and from slave are not 100% identical. In most cases they are but occasionally they are not. I have written small script that ensures that upload is free of race condition and I log md5 sum of each WAL."
The wisdom (or not!) in archiving WAL to the same location from multiple sources (even if they share a common ancestor) notwithstanding, I must admit to having my curiosity piqued.
Let's assume a different situation: - a master and one or more standby units each archiving every WAL file but to it's own archive - we check to see if identically named WAL files are content identical
Does it surprise anybody else that, sometimes, an identically named WAL file from the master and from a standby have different contents? It surprises me.
I would love to know if the differences are due to some oversight in the WAL archiving mechanism chosen by the OP or if, in fact, a master and a standby generate different WAL files!
What does pg_xlogdump say about the differences in the files?