AIP Restore process fails to consistently restore Item Mappings
---------------------------------------------------------------

                 Key: DS-772
                 URL: https://jira.duraspace.org/browse/DS-772
             Project: DSpace
          Issue Type: Bug
          Components: DSpace API
    Affects Versions: 1.7.0
            Reporter: Tim Donohue
            Assignee: Tim Donohue
            Priority: Major
             Fix For: 1.7.0
         Attachments: aip-item-mapping-fix.patch

Reported via Mark Wood & DuraCloud pilot partner testing:

In a full AIP restore (-r -a -f) it is possible to have a set of AIPs in which 
a Collection which maps an Item it does not own, is restored before the 
Collection which does own the Item.  In this case, the recursive restoration of 
the Item throws an exception, because the Item AIP refers to a Collection which 
does not (yet) exist.  
See https://wiki.duraspace.org/display/DSDOC/AIP+Backup+and+Restore for more 
info on running a full AIP restore.  This relates to DS-466.
 
I've done my own local testing of the problem as found by Mark Wood.  I was 
able to replicate this problem.  

I've found what looks to be a quick fix for this issue, which I will attach as 
a patch to this issue, and also work to commit to trunk in time for 1.7.0 RC2. 

 The fix is the following:
(1) When restoring a Collection AIP, try to restore all referenced items 
(whether owned or mapped).  If a mapped item is encountered that cannot be 
restored, throw an error (This is how things already worked, and remain to work)
(2) Provide a new 'skipIfParentMissing' flag which users can use to skip over 
Mapped items that throw errors from #1 above.  This essentially causes the 
error to instead be logged as a warning and the restore process continues
(3) Once the Parent Collection is created (for any mapped items that were 
skipped over), it will auto-restore the Item via the Item AIP.
(4) Whenever an Item is restored via its Item AIP, attempt to map itself to all 
Collections in which it should belong.  In this way, the Item AIP attempts to 
create any mappings that may have been missed in step #1 above.
(5) If an Item AIP attempts to restore a mapping to a Collection which doesn't 
yet exist, then skip over that mapping.  Once the Collection is created, it 
should create that appropriate mapping automatically.

Essentially, previously, we were only mapping in one direction (from Collection 
to reference Items).  Instead, we should be mapping in two directions 
(Collection-to-Item and Item-to-Collection), as we do not know whether the 
Collection or the Item will be created first.   Obviously, when mapping in two 
directions we don't want to accidentally create the same mapping twice -- so 
the code first checks if the mapping already exists.

Patch is attached (based on Trunk, r5906).  I'll also be committing to Trunk as 
I feel this is *very important* to get into 1.7.0RC2, and I've done a large 
amount of testing to ensure this fix doesn't cause any other problems in AIP 
restore process (it doesn't seem to -- the new code should only be called when 
item mappings are encountered)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://jira.duraspace.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel

Reply via email to