min_safe_lsn column in pg_replication_slots view
Fujii Masao <masao.fujii@oss.nttdata.com>
From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: pgsql-hackers@postgresql.org
Date: 2020-06-15T03:40:03Z
Lists: pgsql-hackers
Hi, Per the docs, pg_replication_slots.min_safe_lsn inedicates "the minimum LSN currently available for walsenders". When I executed pg_walfile_name() with min_safe_lsn, the function returned the name of the last removed WAL file instead of minimum available WAL file name. This happens because min_safe_lsn actually indicates the ending position (the boundary byte) of the last removed WAL file. I guess that some users would want to calculate the minimum available WAL file name from min_safe_lsn by using pg_walfile_name(), but the result would be incorrect. Isn't this confusing? min_safe_lsn should indicate the bondary byte + 1, instead? BTW, I just wonder why each row in pg_replication_slots needs to have min_safe_lsn column? Basically min_safe_lsn should be the same between every replication slots. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION
Commits
-
Fix uninitialized value in segno calculation
- b5b4c0fef9fb 14.0 landed
- 794e8e32bb5a 13.0 landed
-
Morph pg_replication_slots.min_safe_lsn to safe_wal_size
- c54b5891f415 13.0 landed
- a8aaa0c786b3 14.0 landed