提交 c63f1b5d 编写于 作者: G Gang Xiong

Release lock when close the table

Regression test find a deadlock issue, the test is as follow:

BEGIN;
CREATE TABLE dtm_plpg_foo (C_CUSTKEY INTEGER, C_NAME VARCHAR(25), C_ADDRESS VARCHAR(40))
partition by range (c_custkey) (partition p1 start(0) end(100000) every(1000));
INSERT INTO dtm_plpg_foo SELECT * FROM dtm_plpg_foo LIMIT 10000;
COMMIT;

The create statement leaked a ROW EXCLUSIVE lock on pg_class. If some other session request
and wait on ACCESS EXCLUSIVE lock before the insert statement, the insert statement will not
be able to get the ACCESS SHARE lock. So the entryDB reader gang will wait the lock holding
by QD process, while the QD process will wait the results from primary reader gangs.
上级 41857ff3
......@@ -2644,7 +2644,7 @@ setRelhassubclassInRelation(Oid relationId, bool relhassubclass)
}
heap_freetuple(tuple);
heap_close(relationRelation, NoLock);
heap_close(relationRelation, RowExclusiveLock);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册