]> git.ipfire.org Git - thirdparty/postgresql.git/commit
pg_stat_replication.sync_state was displayed incorrectly at page boundary.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 23 Nov 2012 16:51:51 +0000 (18:51 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 23 Nov 2012 17:14:54 +0000 (19:14 +0200)
commit3f7b04d6f694b447c17999ef0aed406e658de82f
tree2fbab17c6a3dc9a1269cdc30cadea6be19afa4d0
parent430b47f382609c567bd87ff28a81ea5055d173d5
pg_stat_replication.sync_state was displayed incorrectly at page boundary.

XLogRecPtrIsInvalid() only checks the xrecoff field, which is correct when
checking if a WAL record could legally begin at the given position, but WAL
sending can legally be paused at a page boundary, in which case xrecoff is
0. Use XLByteEQ(..., InvalidXLogRecPtr) instead, which checks that both
xlogid and xrecoff are 0.

9.3 doesn't have this problem because XLogRecPtr is now a single 64-bit
integer, so XLogRecPtrIsInvalid() does the right thing. Apply to 9.2, and
9.1 where pg_stat_replication view was introduced.

Kyotaro HORIGUCHI, reviewed by Fujii Masao.
src/backend/replication/syncrep.c
src/backend/replication/walsender.c