You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@archiva.apache.org by "Maria Odea Ching (JIRA)" <ji...@codehaus.org> on 2008/01/24 12:11:58 UTC

[jira] Commented: (MRM-662) Repo purge is not deleting artifacts in correct order

    [ http://jira.codehaus.org/browse/MRM-662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_121135 ] 

Maria Odea Ching commented on MRM-662:
--------------------------------------

Fixed DaysOldRepoPurge in -r614840.

Changes made:
- fixed up DaysOldRepositoryPurge
- added test case for the fix
- updated existing test cases
- replaced actual jar and pom files used in the test cases with dummies 

> Repo purge is not deleting artifacts in correct order
> -----------------------------------------------------
>
>                 Key: MRM-662
>                 URL: http://jira.codehaus.org/browse/MRM-662
>             Project: Archiva
>          Issue Type: Bug
>          Components: repository scanning
>    Affects Versions: 1.0
>            Reporter: Maria Odea Ching
>            Assignee: Maria Odea Ching
>            Priority: Critical
>
> Looking at the repo purge code by # of days old and by retention count, and while the sorting is correct.. what's being purged isn't actually what is the older artifact, but rather, it is the artifact which is currently being consumed. Here's the part (in DaysOldRepositoryPurge) where this occurs:
> while( versions.iterator().hasNext() )
> {
>   if ( countToPurge-- <= 0 )
>   {
>     break;
>   }
>   doPurgeAllRelated( artifactFile ); 
> } 
> Note: 
> - the artifactFile is the artifact currently being consumed by the repo purge 
> - doPurgeAllRelated(..) deletes the artifact from the repo as well as all related files to it (ex. .sha1, .md5 files, etc.)
> So given the above behavior, if the repo scanner found artifact-1.1.2-20070427.065136-5.jar first before artifact-1.1.2-20070427.065136-2.jar.. then what would actually get deleted from the repo is artifact-1.1.2-20070427.065136-5.jar instead of the older artifact-1.1.2-20070427.065136-2.jar. 

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