logical decoding fix oldestXmin bug

Offering: openGaussDev

More detail: logical decoding fix oldestXmin bug

Match-id-87cb95184273b561cc007bc585ff4e45fc03c45a
This commit is contained in:
openGaussDev
2022-03-10 16:17:53 +08:00
committed by yanghao
parent 734764285d
commit 8fa9add60b

View File

@ -1567,7 +1567,7 @@ TransactionId GetOldestXmin(Relation rel, bool bFixRecentGlobalXmin, bool bRecen
* possible. We need to do so if we're computing the global limit (rel =
* NULL) or if the passed relation is a catalog relation of some kind.
*/
if ((rel == NULL || RelationIsAccessibleInLogicalDecoding(rel)) &&
if ((rel != NULL && RelationIsAccessibleInLogicalDecoding(rel)) &&
TransactionIdIsValid(replication_slot_catalog_xmin) &&
NormalTransactionIdPrecedes(replication_slot_catalog_xmin, result))
result = replication_slot_catalog_xmin;