aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/replication/syncrep.c5
-rw-r--r--src/backend/replication/walsender.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/src/backend/replication/syncrep.c b/src/backend/replication/syncrep.c
index 10af4e85c13..7fe9b09adfa 100644
--- a/src/backend/replication/syncrep.c
+++ b/src/backend/replication/syncrep.c
@@ -375,6 +375,7 @@ SyncRepReleaseWaiters(void)
int numprocs = 0;
int priority = 0;
int i;
+ XLogRecPtr InvalidXLogRecPtr = {0, 0};
/*
* If this WALSender is serving a standby that is not on the list of
@@ -384,7 +385,7 @@ SyncRepReleaseWaiters(void)
*/
if (MyWalSnd->sync_standby_priority == 0 ||
MyWalSnd->state < WALSNDSTATE_STREAMING ||
- XLogRecPtrIsInvalid(MyWalSnd->flush))
+ XLByteEQ(MyWalSnd->flush, InvalidXLogRecPtr))
return;
/*
@@ -405,7 +406,7 @@ SyncRepReleaseWaiters(void)
walsnd->sync_standby_priority > 0 &&
(priority == 0 ||
priority > walsnd->sync_standby_priority) &&
- !XLogRecPtrIsInvalid(walsnd->flush))
+ !XLByteEQ(walsnd->flush, InvalidXLogRecPtr))
{
priority = walsnd->sync_standby_priority;
syncWalSnd = walsnd;
diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c
index c5391676c4a..7ccab20b13e 100644
--- a/src/backend/replication/walsender.c
+++ b/src/backend/replication/walsender.c
@@ -1403,6 +1403,7 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS)
int priority = 0;
int sync_standby = -1;
int i;
+ XLogRecPtr InvalidXLogRecPtr = {0, 0};
/* check to see if caller supports us returning a tuplestore */
if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo))
@@ -1448,14 +1449,14 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS)
* which always returns an invalid flush location, as an
* asynchronous standby.
*/
- sync_priority[i] = XLogRecPtrIsInvalid(walsnd->flush) ?
+ sync_priority[i] = XLByteEQ(walsnd->flush, InvalidXLogRecPtr) ?
0 : walsnd->sync_standby_priority;
if (walsnd->state == WALSNDSTATE_STREAMING &&
walsnd->sync_standby_priority > 0 &&
(priority == 0 ||
priority > walsnd->sync_standby_priority) &&
- !XLogRecPtrIsInvalid(walsnd->flush))
+ !XLByteEQ(walsnd->flush, InvalidXLogRecPtr))
{
priority = walsnd->sync_standby_priority;
sync_standby = i;