Logic for map reduce rerouting