sonatype/nexus — pull request #682 by cstamas (2012-11-29 09:43:36+00:00)
Title: NEXUS-5400: Uploaded file trashed by rebuild md

Since Nexus 2.0 a requirement for repositories is that
from their root ("baseDir"), they must reside on _same volume_
(due to attributes). This change that builds upon that,
and introduces repo "tmp" folder. With this change, we do
not put "tmp" files anymore in the folder where they will
reside, but instead into a "/.nexus/tmp" folder under
same hierarchy (parent folders). Due to "one repo on one volume"
requirement, rename will be still cheap, and not cp+rm operation.
Hence, it does not matter is file in same folder (as before)
or other folder, as long rename happens on single volume.

This still does not resolve other problem revealed: locking.
Rebuild md deletes empty folders (more precisely, what it
"thinks" is empty, see Ben's comment on this issue) without
doing any locking, using the "unprotected" API. But, this was
like it since day 0 it seems.