Re: Allow reading LSN written by walreciever, but not flushed yet
| От | Rahila Syed | 
|---|---|
| Тема | Re: Allow reading LSN written by walreciever, but not flushed yet | 
| Дата | |
| Msg-id | CAH2L28st0ajc1k6y8CH2aTPVXd+kdPSm_6b+9VFGVx-6XMuTFw@mail.gmail.com обсуждение исходный текст  | 
		
| Ответ на | Re: Allow reading LSN written by walreciever, but not flushed yet (Fujii Masao <masao.fujii@oss.nttdata.com>) | 
| Ответы | 
                	
            		Re: Allow reading LSN written by walreciever, but not flushed yet
            		
            		 | 
		
| Список | pgsql-hackers | 
I've been following this discussion and have a question I'd like to ask.
XLogWalRcvFlush() only updates flushedUpto if LogstreamResult.Flush has advanced,
while XLogWalRcvWrite() updates writtenUpto unconditionally. That means the flush
LSN (as reported by pg_last_wal_receive_lsn()) never moves backward, whereas
the write LSN might. Because of this difference in behavior, I was thinking that
we might need to track the maximum write LSN seen so far and have the function
return that value.
Can you please explain the scenarios in which the record pointer of the WAL record written
by the receiver can move backwards.
For example, in physical replication, the WAL records are sent after a Flush on the primary in ascending
order of XLogRecPtr. They are also received in that order and written as they arrive by the receiver.
Are you referring to crash scenarios where unflushed WAL may be discarded and receiver has
to move backwards and start from the last flushed record on the standby?
Thank you,
by the receiver can move backwards.
For example, in physical replication, the WAL records are sent after a Flush on the primary in ascending
order of XLogRecPtr. They are also received in that order and written as they arrive by the receiver.
Are you referring to crash scenarios where unflushed WAL may be discarded and receiver has
to move backwards and start from the last flushed record on the standby?
Thank you,
Rahila Syed
В списке pgsql-hackers по дате отправления: