Avoid upgrading lock for INSERT statements
Commit 3fe43b8a introduced a lock upgrade in the plan revalidation for UDFs. This makes the lock acquire in RevalidateCachedPlanWithParams() match CdbTryOpenRelation() closer in order to avoid distributed deadlock for UPDATE/DELETE DMLs. It does however also upgrade the lock for INSERT which is overly aggressive. Fix by only upgrading the lock for the two specified DML commands. Also includes an isolationtest test that cause distributed deadlock without this patch. This solves reported cases of deadlock introduced around INSERTs in UDFs.
Showing
想要评论请 注册 或 登录