Skip to content

Commit

Permalink
HADOOP-12352. Delay in checkpointing Trash can leave trash for 2 inte…
Browse files Browse the repository at this point in the history
…rvals before deleting. Contributed by Casey Brotherton.
  • Loading branch information
Harsh J committed Aug 25, 2015
1 parent 57c7ae1 commit af78767
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions hadoop-common-project/hadoop-common/CHANGES.txt
Expand Up @@ -796,6 +796,9 @@ Release 2.8.0 - UNRELEASED

BUG FIXES

HADOOP-12352. Delay in checkpointing Trash can leave trash for 2 intervals
before deleting (Casey Brotherton via harsh)

HADOOP-11802: DomainSocketWatcher thread terminates sometimes after there
is an I/O error during requestShortCircuitShm (cmccabe)

Expand Down
Expand Up @@ -161,12 +161,19 @@ public boolean moveToTrash(Path path) throws IOException {
@SuppressWarnings("deprecation")
@Override
public void createCheckpoint() throws IOException {
createCheckpoint(new Date());
}

@SuppressWarnings("deprecation")
public void createCheckpoint(Date date) throws IOException {

if (!fs.exists(current)) // no trash, no checkpoint
return;

Path checkpointBase;
synchronized (CHECKPOINT) {
checkpointBase = new Path(trash, CHECKPOINT.format(new Date()));
checkpointBase = new Path(trash, CHECKPOINT.format(date));

}
Path checkpoint = checkpointBase;

Expand Down Expand Up @@ -287,7 +294,7 @@ public void run() {
TrashPolicyDefault trash = new TrashPolicyDefault(
fs, home.getPath(), conf);
trash.deleteCheckpoint();
trash.createCheckpoint();
trash.createCheckpoint(new Date(now));
} catch (IOException e) {
LOG.warn("Trash caught: "+e+". Skipping "+home.getPath()+".");
}
Expand Down

0 comments on commit af78767

Please sign in to comment.