diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index bf3dbda901d..2ef18f4d957 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -8502,14 +8502,14 @@ xlog_redo(XLogReaderState *record) memcpy(&xlrec, XLogRecGetData(record), sizeof(xl_parameter_change)); /* - * Invalidate logical slots if we are in hot standby and the primary + * Invalidate logical slots if we are in recovery and the primary * does not have a WAL level sufficient for logical decoding. No need * to search for potentially conflicting logically slots if standby is * running with wal_level lower than logical, because in that case, we * would have either disallowed creation of logical slots or * invalidated existing ones. */ - if (InRecovery && InHotStandby && + if (InRecovery && xlrec.wal_level < WAL_LEVEL_LOGICAL && wal_level >= WAL_LEVEL_LOGICAL) InvalidateObsoleteReplicationSlots(RS_INVAL_WAL_LEVEL,