What's difference among insert/write/flush lsn?

Started by Jinhua Luoalmost 6 years ago2 messages
#1Jinhua Luo
luajit.io@gmail.com

Hi,

pg_current_wal_flush_lsn()pg_lsnGet current write-ahead log flush location
pg_current_wal_insert_lsn()pg_lsnGet current write-ahead log insert location
pg_current_wal_lsn()pg_lsnGet current write-ahead log write location

I guess write is about how many bytes written in shared cache, and
flush is flush to file, which makes it persistent.

Anybody gives some official explanation?
Thanks.

Regards,
Jinhua Luo

#2Bruce Momjian
bruce@momjian.us
In reply to: Jinhua Luo (#1)
Re: What's difference among insert/write/flush lsn?

On Sat, Feb 1, 2020 at 11:18:42AM +0800, Jinhua Luo wrote:

Hi,

pg_current_wal_flush_lsn()pg_lsnGet current write-ahead log flush location
pg_current_wal_insert_lsn()pg_lsnGet current write-ahead log insert location
pg_current_wal_lsn()pg_lsnGet current write-ahead log write location

I guess write is about how many bytes written in shared cache, and
flush is flush to file, which makes it persistent.

Anybody gives some official explanation?

I think the insert location is where data is being added to WAL, the
write location is where it was last written to the file system, and
flush is the last time is was flushed to storage.

--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EnterpriseDB https://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +