alfresco-community-repo icon indicating copy to clipboard operation
alfresco-community-repo copied to clipboard

Fix/mnt 22293 limit on declare version as record

Open brijmohan1 opened this issue 3 years ago • 1 comments

brijmohan1 avatar Jul 12 '22 11:07 brijmohan1

I think the issue in general is not something that can sensibly be solved. I think to check for cycles in the general case then we have to traverse almost every parent-child relationship in the repository.

I noticed this comment:

     * TODO: When is it cheaper to go up and when is it cheaper to go down?
     *       Look at using direct queries to pass through layers both up and down.

For the problem we're trying to solve then I think we know there's no cycle because the node has no children? If this is the case then we could solve the problem by changing the logic to do:

If the child has no children
  // No cycle
else
  // Perform existing check

This would improve performance for the majority of cases (creating a new child) and make it slightly worse when moving a folder or adding a secondary parent association to a folder.

tpage-alfresco avatar Jul 13 '22 15:07 tpage-alfresco