Fix a bug that two-phase sub-transaction is considered as one-phase.
QD backend should not forget whether a sub transaction performed writes QD backend process can avoid two-phase commit overhead if it knows that no QEs involved in this transaction or any of its sub transactions performed any writes. Previously, if a sub transaction performed write on one or more QEs, it was remembered in that sub transaction's global state. However, the sub transaction state was lost after sub transaction commit. That resulted in QD not performing two-phase commit at the end of top transaction. In fact, regardless of the transaction nesting level, we only need to remember whether a write was performed by a sub transaction. Therefore, use a backend global variable, instead of current transaction state to record this information. Reviewed-by: NGang Xiong <gxiong@pivotal.io> Reviewed-by: NHao Wu <gfphoenix78@gmail.com> Reviewed-by: NAsim R P <apraveen@pivotal.io>
Showing
想要评论请 注册 或 登录