diff --git a/src/backend/cdb/dispatcher/cdbdisp_async.c b/src/backend/cdb/dispatcher/cdbdisp_async.c index 9cbce934a4a5da8c996d40e074c2a0b88d46c43f..262c02c1b7b3e7bc432c198854cd9785ed83476e 100644 --- a/src/backend/cdb/dispatcher/cdbdisp_async.c +++ b/src/backend/cdb/dispatcher/cdbdisp_async.c @@ -915,8 +915,18 @@ processResults(CdbDispatchResult *dispatchResult) } if (segdbDesc->conn->wrote_xlog) + { MarkTopTransactionWriteXLogOnExecutor(); + /* + * Reset the worte_xlog here. Since if the received pgresult not process + * the xlog write message('x' message sends from QE in ReadyForQuery), + * the value may still refer to previous dispatch statement. Which may + * always mark current top transaction has wrote xlog on executor. + */ + segdbDesc->conn->wrote_xlog = false; + } + /* * Attach the PGresult object to the CdbDispatchResult object. */