Skip to content

Commit

Permalink
Fixing Issues when deletes had race condition (#2678)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeniawhite authored Feb 7, 2017
1 parent 2d5bf7f commit 92796da
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/server/object_services/map_deleter.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ function delete_object_mappings(obj) {
}

function delete_chunks_if_unreferenced(chunk_ids, delete_date) {
dbg.log2('delete_chunks_if_unreferenced: chunk_ids', chunk_ids);
return MDStore.instance().find_parts_unreferenced_chunk_ids(chunk_ids)
.then(unreferenced_chunk_ids => delete_chunks(unreferenced_chunk_ids, delete_date));
}

function delete_chunks(chunk_ids, delete_date) {
dbg.log2('delete_chunks: chunk_ids', chunk_ids);
return P.join(
MDStore.instance().find_blocks_of_chunks(chunk_ids),
MDStore.instance().delete_blocks_of_chunks(chunk_ids, delete_date),
Expand Down
14 changes: 7 additions & 7 deletions src/server/object_services/md_store.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ class MDStore {
deleted: delete_date
},
$rename: {
obj: 'obj_del',
// obj: 'obj_del',
num: 'num_del',
}
});
Expand Down Expand Up @@ -612,9 +612,9 @@ class MDStore {
deleted: delete_date
},
$rename: {
obj: 'obj_del',
// obj: 'obj_del',
start: 'start_del',
chunk: 'chunk_del',
// chunk: 'chunk_del',
}
});
}
Expand Down Expand Up @@ -876,10 +876,10 @@ class MDStore {
$set: {
deleted: delete_date
},
$rename: {
chunk: 'chunk_del',
node: 'node_del',
}
// $rename: {
// chunk: 'chunk_del',
// node: 'node_del',
// }
});
}

Expand Down

0 comments on commit 92796da

Please sign in to comment.