Uploaded image for project: 'Repository'
  1. Repository
  2. REPO-1688

Restore Site should disable lockable behaviour (to be symmetric with delete/purge)

    Details

    • Bug Priority:
      Category 2
    • Work Funnel:
      Architecture
    • Sprint:
      Repository Sprint 10
    • Story Points:
      5
    • Work Funnel End:
      2017-07

      Description

      It was noted in MNT-17093 and ACE-5465 that a "restore site" failed due to lockable aspect, as an after effect of introducing MNT-14671.

      The MNT-14671 enhancement allows sites to be deleted even when they contain at least one locked node (prior to that, the site deletion would be prevented). This was implemented by disabling the lockable aspect behaviour for site deletion.

      I would expect the behaviour (sorry, no pun intended) to be symmetric when attempting to restore a site. Otherwise, you may see a stacktrace similar (but not identical) to:

      2016-12-08 18:17:08,047  ERROR [node.archive.NodeArchiveServiceImpl] [main] An unhandled exception stopped the restore
       org.alfresco.service.cmr.lock.NodeLockedException: 11080032 Cannot perform operation since the node (id:a8d7de7f-ffcf-4974-9a70-c8ec4128ea0e) is locked.
      	at org.alfresco.repo.lock.LockServiceImpl.checkForLock(LockServiceImpl.java:659)
      	at org.alfresco.repo.lock.LockServiceImpl.beforeUpdateNode(LockServiceImpl.java:738)
      ...
      	at org.alfresco.repo.node.AbstractNodeServiceImpl.invokeBeforeUpdateNode(AbstractNodeServiceImpl.java:367)
      ....
      	at com.sun.proxy.$Proxy23.setProperty(Unknown Source)
      ....
      	at org.alfresco.repo.site.SiteServiceImplMoreTest.onCreateNodeSetTitle(SiteServiceImplMoreTest.java:1190)
      ....
      	at org.alfresco.repo.policy.JavaBehaviour$JavaMethodInvocationHandler.invoke(JavaBehaviour.java:181)
      ....
      	at org.alfresco.repo.policy.$Proxy171.onCreateNode(Unknown Source)
      	at org.alfresco.repo.node.AbstractNodeServiceImpl.invokeOnCreateNode(AbstractNodeServiceImpl.java:312)
      ....
      	at org.alfresco.repo.node.db.DbNodeServiceImpl.restoreNode(DbNodeServiceImpl.java:2649)
      ....
      	at com.sun.proxy.$Proxy23.restoreNode(Unknown Source)
      ....
      	at org.alfresco.repo.node.archive.NodeArchiveServiceImpl.restoreArchivedNode(NodeArchiveServiceImpl.java:367)
      ....
      

      Acceptance Criteria

      • step1: write a JUnit test that demonstrates the issue and causes a similar failure to stacktrace above. In the absence of the thumbnail modification data (which shifted the issue, as per r129765) we may need to see if a custom behaviour onCreateNode policy can cause an update to the node, such that the restore site operation fails due to NodeLockException (on a read-only lock that is owned by someone other than the person doing the restore site, ie. site manager)
        • DONE - see comment below => r133520 (DEV/5.2.N)
      • step2: implement a fix that disables the lockable aspect behaviour when specifically restoring a site (in the same way that we do when deleting a site, see changes that were part of MNT-14671). Enable the test.

      Notes

      • note to QA - peer review of the automated test, manual testing may not be required (other than re-running any existing tests around "restore site") unless we can identify suitable repeatable steps that cause the error (even after r129765)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jvonka Jan Vonka
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: