Error if AssignTransactionId is called by Reader.
QE_READER and QE_ENTRY_DB_SINGLETON are not expected to allocate transaction
IDs. They are just helper sub-processes to WRITER and should be using its xid.
@@ -496,6 +496,13 @@ AssignTransactionId(TransactionState s)
Assert(!TransactionIdIsValid(s->transactionId));
Assert(s->state == TRANS_INPROGRESS);
+ if (DistributedTransactionContext == DTX_CONTEXT_QE_READER ||
+ DistributedTransactionContext == DTX_CONTEXT_QE_ENTRY_DB_SINGLETON)
+ {
+ elog(ERROR, "AssignTransactionId() called by %s process",
+ DtxContextToString(DistributedTransactionContext));
+ }
+
/*
* Ensure parent(s) have XIDs, so that a child always has an XID later
* than its parent. Musn't recurse here, or we might get a stack overflow
