Fix pg_recvlogical avoidance of superfluous Standby Status Update.
authorNoah Misch <[email protected]>
Thu, 14 May 2020 03:42:09 +0000 (20:42 -0700)
committerNoah Misch <[email protected]>
Thu, 14 May 2020 03:42:49 +0000 (20:42 -0700)
The defect suppressed a Standby Status Update message when bytes flushed
to disk had changed but bytes received had not changed.  If
pg_recvlogical then exited with no intervening Standby Status Update,
the next pg_recvlogical repeated already-flushed records.  The defect
could also cause superfluous messages, which are functionally harmless.
Back-patch to 9.5 (all supported versions).

Discussion: https://postgr.es/m/20200502221647[email protected]

src/bin/pg_basebackup/pg_recvlogical.c

index 5907d607b094d3868c891dd53d2c89f5d3af1189..7101f5fd51544cdc15b36c6f6bfc36b6aab03bdc 100644 (file)
@@ -121,7 +121,7 @@ sendFeedback(PGconn *conn, int64 now, bool force, bool replyRequested)
     */
    if (!force &&
        last_written_lsn == output_written_lsn &&
-       last_fsync_lsn != output_fsync_lsn)
+       last_fsync_lsn == output_fsync_lsn)
        return true;
 
    if (verbose)