Skip to content

Commit 096bbba

Browse files
committed
Fix for CDBD expand with concurrent distributed tx
An duct tape for this was already added as fc8aab8, through redo path was not patched there. Copy same logic into redoDistributedCommitRecord function boby.
1 parent ae58802 commit 096bbba

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/backend/cdb/cdbdtxrecovery.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,17 @@ redoDistributedCommitRecord(DistributedTransactionId gxid)
493493
int i;
494494
bool is_hot_standby_qd = IS_HOT_STANDBY_QD();
495495

496+
/*
497+
* The coordinator may execute write DTX during gpexpand, so the newly
498+
* added segment may contain DTX info in checkpoint XLOG. However, this step
499+
* is useless and should be avoided for segments, or fatal may be thrown since
500+
* max_tm_gxacts is 0 in segments. See also fc8aab88d
501+
*/
502+
if (ConvertMasterDataDirToSegment && !IS_QUERY_DISPATCHER())
503+
{
504+
return;
505+
}
506+
496507
/*
497508
* Only the startup process can be modifying shmNumCommittedGxacts
498509
* and shmCommittedGxidArray. So should be OK reading the value w/o lock.

0 commit comments

Comments
 (0)