diff --git a/src/backend/cdb/dispatcher/cdbdisp_async.c b/src/backend/cdb/dispatcher/cdbdisp_async.c index cbed2e4113a2aa6448a36b117e9242351657ba4b..f8485382ef3a3d5656fe6974b5f87d20747fc050 100644 --- a/src/backend/cdb/dispatcher/cdbdisp_async.c +++ b/src/backend/cdb/dispatcher/cdbdisp_async.c @@ -910,8 +910,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. */