Re: Strange decreasing value of pg_last_wal_receive_lsn()
| От | godjan • | 
|---|---|
| Тема | Re: Strange decreasing value of pg_last_wal_receive_lsn() | 
| Дата | |
| Msg-id | C1BDB628-A26D-4D14-A481-341A239089B7@gmail.com обсуждение исходный текст  | 
		
| Ответ на | Re: Strange decreasing value of pg_last_wal_receive_lsn() (Sergei Kornilov <sk@zsrv.org>) | 
| Ответы | 
                	
            		Re: Strange decreasing value of pg_last_wal_receive_lsn()
            		
            		 Re: Strange decreasing value of pg_last_wal_receive_lsn()  | 
		
| Список | pgsql-hackers | 
		
			I got it, thank you.
		
	
	
Can you recommend what to use to determine which quorum standby should be promoted in such case?
We planned to use pg_last_wal_receive_lsn() to determine which has fresh data but if it returns the beginning of the segment on both replicas we can’t determine which standby confirmed that write transaction to disk.
On 8 May 2020, at 14:50, Sergei Kornilov <sk@zsrv.org> wrote:Hello
Yes, this is expected. Walreceiver always start streaming from beginning of the wal segment.
./src/backend/replication/walreceiverfuncs.c in RequestXLogStreaming:
* We always start at the beginning of the segment. That prevents a broken
* segment (i.e., with no records in the first half of a segment) from
* being created by XLOG streaming, which might cause trouble later on if
* the segment is e.g archived.
regards, Sergei
В списке pgsql-hackers по дате отправления: