}
//Update the directory entries
try {
dir.deletePrimaryIndexKey(key);
for (Node destination : destinations)
dir.insertPrimaryIndexKey(destination, key);
} catch (RuntimeException e) {
try {
//try to repair the damage
for (Node origin : origins)
dir.insertPrimaryIndexKey(origin, key);