Fix lockmode issuses
Lockmode of Update|Delete or Select-for-update Statement
is controlled by: whether the table is AO or heap and the
GUC gp_enable_global_deadlock_detector.
The logic for lockmode is:
1. Select-for-update always hold ExclusiveLock
2. UPDATE|DELETE on AO tables always hold ExclusiveLock
3. UPDATE|DELETE on heap tables hold ExclusiveLock when
gp_enable_global_deadlock_detector is off, otherwise
hold RowExclusiveLock
We hold locks in parser stage and Initplan before executing,
the lockmode should be the same at the two stages.
This commit fixes lockmode issues to make things correct.
Co-authored-by: NShujie Zhang <shzhang@pivotal.io>
Showing
想要评论请 注册 或 登录