enhance tuple lock

This commit is contained in:
chenxiaobin19
2021-12-16 20:37:27 +08:00
parent 2417964517
commit 899cd4a36c
92 changed files with 4402 additions and 1177 deletions

View File

@ -708,7 +708,8 @@ IndexScanState* ExecInitIndexScan(IndexScan* node, EState* estate, int eflags)
* occured after taking the snapshot.
*/
if (RelationIsUstoreFormat(index_state->ss.ss_currentPartition)) {
TransactionId relfrozenxid64 = getPartitionRelfrozenxid(index_state->ss.ss_currentPartition);
TransactionId relfrozenxid64 = InvalidTransactionId;
getPartitionRelxids(index_state->ss.ss_currentPartition, &relfrozenxid64);
if (TransactionIdPrecedes(FirstNormalTransactionId, scanSnap->xmax) &&
!TransactionIdIsCurrentTransactionId(relfrozenxid64) &&
TransactionIdPrecedes(scanSnap->xmax, relfrozenxid64)) {
@ -733,7 +734,8 @@ IndexScanState* ExecInitIndexScan(IndexScan* node, EState* estate, int eflags)
* occured after taking the snapshot.
*/
if (RelationIsUstoreFormat(current_relation)) {
TransactionId relfrozenxid64 = getRelationRelfrozenxid(current_relation);
TransactionId relfrozenxid64 = InvalidTransactionId;
getRelationRelxids(current_relation, &relfrozenxid64);
if (TransactionIdPrecedes(FirstNormalTransactionId, scanSnap->xmax) &&
!TransactionIdIsCurrentTransactionId(relfrozenxid64) &&
TransactionIdPrecedes(scanSnap->xmax, relfrozenxid64)) {