Skip to content

Commit d2f1685

Browse files
authored
Fix for CDBD expand with concurrent distributed tx (apache#1801) (#38)
An duct tape for this was already added as fc8aab8, through redo path was not patched there. Copy same guard into redoDistributedCommitRecord function boby.
1 parent f923fa5 commit d2f1685

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)