fix parallel decoding visibility bug
Offering: openGaussDev More detail: parallel decoding fix physical addressing info bug. Match-id-491e37c4587a09f855ba3022206f5aaae7a8831f
This commit is contained in:
2
src/common/backend/utils/cache/relcache.cpp
vendored
2
src/common/backend/utils/cache/relcache.cpp
vendored
@ -2456,7 +2456,7 @@ void RelationInitPhysicalAddr(Relation relation)
|
|||||||
* tables and on user tables declared as additional catalog
|
* tables and on user tables declared as additional catalog
|
||||||
* tables.
|
* tables.
|
||||||
*/
|
*/
|
||||||
if (HistoricSnapshotActive() && RelationIsAccessibleInLogicalDecoding(relation) && IsTransactionState()) {
|
if (HistoricSnapshotActive() && RelationIsAccessibleInLogicalDecoding(relation)) {
|
||||||
HeapTuple phys_tuple;
|
HeapTuple phys_tuple;
|
||||||
Form_pg_class physrel;
|
Form_pg_class physrel;
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ CommitSeqNo TransactionIdGetCommitSeqNo(TransactionId transactionId, bool isComm
|
|||||||
* Before going to the commit log manager, check our single item cache to
|
* Before going to the commit log manager, check our single item cache to
|
||||||
* see if we didn't just check the transaction status a moment ago.
|
* see if we didn't just check the transaction status a moment ago.
|
||||||
*/
|
*/
|
||||||
if ((snapshot == NULL || !IsVersionMVCCSnapshot(snapshot)) &&
|
if ((snapshot == NULL || (!IsVersionMVCCSnapshot(snapshot) && !(snapshot->satisfies == SNAPSHOT_DECODE_MVCC))) &&
|
||||||
TransactionIdEquals(transactionId, t_thrd.xact_cxt.cachedFetchCSNXid)) {
|
TransactionIdEquals(transactionId, t_thrd.xact_cxt.cachedFetchCSNXid)) {
|
||||||
t_thrd.xact_cxt.latestFetchCSNXid = t_thrd.xact_cxt.cachedFetchCSNXid;
|
t_thrd.xact_cxt.latestFetchCSNXid = t_thrd.xact_cxt.cachedFetchCSNXid;
|
||||||
t_thrd.xact_cxt.latestFetchCSN = t_thrd.xact_cxt.cachedFetchCSN;
|
t_thrd.xact_cxt.latestFetchCSN = t_thrd.xact_cxt.cachedFetchCSN;
|
||||||
@ -98,15 +98,15 @@ RETRY:
|
|||||||
* If the XID is older than RecentGlobalXmin, check the clog. Otherwise
|
* If the XID is older than RecentGlobalXmin, check the clog. Otherwise
|
||||||
* check the csnlog.
|
* check the csnlog.
|
||||||
*/
|
*/
|
||||||
if (!isMvcc || GTM_LITE_MODE) {
|
if (snapshot != NULL && snapshot->satisfies == SNAPSHOT_DECODE_MVCC) {
|
||||||
|
xid = GetReplicationSlotCatalogXmin();
|
||||||
|
} else if (!isMvcc || GTM_LITE_MODE) {
|
||||||
TransactionId recentGlobalXmin = pg_atomic_read_u64(&t_thrd.xact_cxt.ShmemVariableCache->recentGlobalXmin);
|
TransactionId recentGlobalXmin = pg_atomic_read_u64(&t_thrd.xact_cxt.ShmemVariableCache->recentGlobalXmin);
|
||||||
if (!TransactionIdIsValid(recentGlobalXmin)) {
|
if (!TransactionIdIsValid(recentGlobalXmin)) {
|
||||||
xid = t_thrd.xact_cxt.ShmemVariableCache->recentLocalXmin;
|
xid = t_thrd.xact_cxt.ShmemVariableCache->recentLocalXmin;
|
||||||
} else {
|
} else {
|
||||||
xid = recentGlobalXmin;
|
xid = recentGlobalXmin;
|
||||||
}
|
}
|
||||||
} else if (snapshot != NULL && snapshot->satisfies == SNAPSHOT_DECODE_MVCC) {
|
|
||||||
xid = GetReplicationSlotCatalogXmin();
|
|
||||||
} else if (snapshot != NULL && IsMVCCSnapshot(snapshot)) {
|
} else if (snapshot != NULL && IsMVCCSnapshot(snapshot)) {
|
||||||
xid = snapshot->xmin;
|
xid = snapshot->xmin;
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user