A customer reported a performance Issue when upgrading a 2.2.8 environment to 3.4.14: it comes mainly from the update_PrimaryChildrenSharedAcl and select_NodePrimaryChildAcls on the the nodeDAO.setNodeDefiningAclId(nodeId, inheritedAclId) this call is strange because if children acl_id is null, then it will be also be updated a second time with the same inherited id and this method will be called with that children in parameter. This done million of times for a big repo can be very time consuming.
this is done on the ADMAccessControlListDAO.java implements the migration from the old implementation to the new.
The partner did some changes on this class to accomplish the upgrade on the target time of serveral hours, (where before were days order of magnitude) theses changes consisted of disabling one costly method call setting acl_id of child nodes (having acl_id null) with inherited acl_id (that's also being done one by one in a more efficent way).
Attaching the modified java class for its reviewing and eventually commiting this change to our source.
STEPS TO REPRODUCE:
you can use an environment with 2M nodes on 2.2.8
ensure that the nodes have some random acls (we need several thousands acls)
the Patch updateDmPermissions is run on the process and takes a lot of time to complete.
it appear that the main processing time is spend on 2 methods : getPrimaryChildrenAcls and setPrimaryChildrenSharedAclId