[ 
https://jira.duraspace.org/browse/DS-712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tim Donohue updated DS-712:
---------------------------

      Priority: Critical  (was: Blocker)
    Attachment: update-sequences-postgres.patch

I've decided to take a slightly different route to resolving this issue for AIP 
restores.

I've attached a patch that makes a change to the 'update-sequences.sql' script 
for PostgreSQL (still working on an Oracle version -- will be attached as soon 
as I complete it).   This patch changes how the 'handle_seq' is updated, such 
that it is now based on the *maximum handle suffix* rather than the maximum 
value of 'handle_id' in the 'handle' table.

So, as an example, if your maximum handle was "123456789/6647", but the maximum 
'handle_id' is just 102, then running 'update-sequences.sql' would update your 
'handle_seq' to 6647  (which means the next handle created will be 
123456789/6648).    Previously, it would have updated the value to 102 (which, 
as described above, could result in conflicts in your DB).

In the end, if the 'update-sequences.sql' script is properly updating the 
'handle_seq' to avoid conflicts, then we can just recommend to *always* run 
'update-sequences.sql' after a major AIP restore or replace.  This will ensure 
the DB never enters an unstable state.

Comments or counter-proposals welcome!

> DSpace Fails to Check if a Handle is already assigned before assigning a new 
> handle
> -----------------------------------------------------------------------------------
>
>                 Key: DS-712
>                 URL: https://jira.duraspace.org/browse/DS-712
>             Project: DSpace
>          Issue Type: Bug
>          Components: DSpace API
>    Affects Versions: 1.7.0
>            Reporter: Tim Donohue
>            Assignee: Tim Donohue
>            Priority: Critical
>             Fix For: 1.7.0
>
>         Attachments: update-sequences-postgres.patch
>
>
> Not sure how this hasn't come up before, but I just noticed this in terms of 
> testing the new AIP Backup/Restore functionality (DS-466).
> DSpace currently makes a highly flawed assumption when assigning new Handles. 
>  It will *always* assign a Handle equal to the next available value in the 
> 'handle_seq' (which is just the max value of 'handle_id' in the 'handle' 
> table).  See the HandleManager.createHandle() method.
> This becomes extremely fragile when you have content which has been migrated 
> or restored from another DSpace (for example, via the AIP backup/restore 
> feature).   In those instances, it you may end up restoring/migrating content 
> that looks like this:
> handle_id = 44 (or whatever the next value in 'handle_seq' is)
> handle = 123456789/50 (or whatever the restored handle should be)
> Once the value of 'handle_id' reaches the suffix value of a restored handle, 
> then you will run into database conflicts & will be unable to submit any new 
> content into DSpace.  So, in the above example, as soon as 'handle_seq" gets 
> to the value of 50, Dspace will attempt to assign a new handle of 
> '123456789/50' to the next object created.  However, as that handle is 
> already in use, the new object will always fail to be created.  In other 
> words, the DSpace system will fail to accept any new objects.
> The fix would be to first ensure a handle is *not* already in use before 
> assigning it -- essentially looking for the next available handle (rather 
> than the next value of 'handle_seq") before assigning the handle.  However, I 
> need to determine a reasonable way to locate the next available handle 
> (preferably something that will scale relatively well for larger installs). 
> Ideas / thoughts / brainstorms welcome.  I've marked this as a "Blocker" for 
> DSpace 1.7.0, as it essentially makes your DSpace unusable if you were to 
> encounter this bug.  (The only way to get around this issue if you 
> encountered it is to manually increase your "handle_seq" so that it's greater 
> than the largest handle suffix in your system.)

-- 
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

        

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel

Reply via email to