Skip to content

Commit

Permalink
pool: Fix race leading to false positices in pool size health checks
Browse files Browse the repository at this point in the history
The pool would register free space before actually deleting the file
from the file system. Thus for a brief moment, the pool would appear
to have more free space that is available on disk.

Target: trunk
Require-notes: yes
Require-book: no
Request: 2.10
Request: 2.9
Request: 2.8
Request: 2.7
Request: 2.6
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: https://rb.dcache.org/r/7367/
(cherry picked from commit dbd6b70)
  • Loading branch information
gbehrmann committed Oct 17, 2014
1 parent 8d3ebe1 commit 556ee8f
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -952,8 +952,14 @@ void destroyWhenRemovedAndUnused(MetaDataRecord entry)
PnfsId id = entry.getPnfsId();
if (entry.getLinkCount() == 0 && state == EntryState.REMOVED) {
setState(entry, DESTROYED);
_account.free(entry.getSize());
_store.remove(id);

/* It is essential to free after we removed the file: This is the opposite
* of what happens during allocation, in which we allocate before writing
* to disk. We rely on never having anything on disk that we haven't accounted
* for in the Account object.
*/
_account.free(entry.getSize());
}
}
}
Expand Down

0 comments on commit 556ee8f

Please sign in to comment.