Skip to content

Commit

Permalink
bugfix: http:// replicas were not handled correctly - test_redundant …
Browse files Browse the repository at this point in the history
…failed. Pick a random replica, not always the first one.
  • Loading branch information
Ville Tuulos committed Apr 16, 2011
1 parent b48a46e commit 9fcc740
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion master/src/fair_scheduler_job.erl
Expand Up @@ -328,7 +328,9 @@ assign_nopref(Task, _Tasks, _Nodes) when Task#task.force_local ->

assign_nopref(Task, Tasks, _Nodes) ->
{N, C, L} = gb_trees:get(nopref, Tasks),
[{Input, _}|_] = Task#task.input,
% Choosing a nopref-replica randomly is clearly a suboptimal policy.
% We should ignore replicas that have failed in the past.
{Input, _} = ddfs_util:choose_random(Task#task.input),
T = Task#task{chosen_input = Input},
gb_trees:update(nopref, {N + 1, C + 1, [T|L]}, Tasks).

Expand Down

0 comments on commit 9fcc740

Please sign in to comment.