On Fri, Mar 13, 2020 at 8:42 AM Dilip Kumar <dilipbal...@gmail.com> wrote: > > On Thu, Mar 12, 2020 at 7:50 PM Kuntal Ghosh <kuntalghosh.2...@gmail.com> > > wrote: > > > > > + /* > > > + * The relation extension or page lock can never participate in actual > > > + * deadlock cycle. See Asserts in LockAcquireExtended. So, there is > > > + * no advantage in checking wait edges from it. > > > + */ > > > + if ((LOCK_LOCKTAG(*lock) == LOCKTAG_RELATION_EXTEND) || > > > + (LOCK_LOCKTAG(*lock) == LOCKTAG_PAGE)) > > > + return false; > > > + > > > Since this is true, we can also avoid these kind of locks in > > > ExpandConstraints, right? > > I am not sure I understand this part. Because topological sort will > work on the soft edges we have created when we found the cycle, but > for relation extension/page lock we are completely ignoring hard/soft > edge then it will never participate in topo sort as well. Am I > missing something? > No, I think you're right. We only add constraints if we've detected a cycle in the graph. Hence, you don't need the check here.
-- Thanks & Regards, Kuntal Ghosh EnterpriseDB: http://www.enterprisedb.com