sonatype/nexus — pull request #145 by cstamas (2011-12-13 07:47:01+00:00)
Title: NEXUS-4660: Attributes improvements

Contains:
* NEXUS-4676: Upgrade strategy
* NEXUS-4677: Smarter FSPeer to keep backup files in case of attributes

Upgrade strategy

It is implemented in a way to be applicable to all upgrade scenarios (pre2.0-2.0, pre2.0-post2.0, post2.0-post2.0), but is avoiding to use scheduler (to not cause config changes) and also marks work "done" in persistent fashion (by placing marker files in legacy directories) to not have to repeat -- potentially -- huge amount of work between reboots. In short: when detected as needed, a daemon thread (to not interfere with probable reboots during upgrade) is spawned that will simply upgrade attributes of each repository, and when done, will mark the legacy attribute folder of given legacy folder as "done". Once all work is done (all attribute folders marked as "done"), it will nag the user on every Nexus boot to "delete, move or rename" the legacy folder since it's upgraded. Once folder is not present anymore, it goes on silently to not pollute the logs.

Smarter FS Peer

The FS Peer is not able to distinguish is it "attribute being handled" or not, and according to it will perform cleanup (as today) in case of non-attributes or leave backup files in case of attributes (as user chance to perform fixes and not loose data).