Skip to content

Instantly share code, notes, and snippets.

@No9

No9/output.txt Secret

Created June 24, 2013 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save No9/e090bffc9c99e97f198c to your computer and use it in GitHub Desktop.
Save No9/e090bffc9c99e97f198c to your computer and use it in GitHub Desktop.
Replay bug in map-reduce. If I run example.js in https://github.com/dominictarr/map-reduce multiple times I get the following inconsistent results. Some times the reduce seems to fire twice for each type. Other times it fires once for one type and twice for another. other times it behaves as expected
************************************
Expected Results
MAP a 1 -> odd
MAP c 3 -> odd
MAP d 4 -> even
MAP b 2 -> even
MAP e 5 -> odd
Reduce [ 'even' ] 6
Reduce [ 'odd' ] 9
Reduce [] 15
************************************
anton@NO9LAP002:~/github/map-reduce$ node example.js
MAP c 3 -> odd
MAP d 4 -> even
MAP b 2 -> even
MAP a 1 -> odd
MAP e 5 -> odd
Reduce [ 'odd' ] 9
Reduce [ 'even' ] 6
Reduce [] 15
Reduce [ 'odd' ] 9
Reduce [] 15
anton@NO9LAP002:~/github/map-reduce$ node example.js
MAP a 1 -> odd
MAP c 3 -> odd
MAP b 2 -> even
MAP d 4 -> even
MAP e 5 -> odd
Reduce [ 'even' ] 6
Reduce [ 'odd' ] 9
Reduce [] 15
Reduce [ 'even' ] 6
Reduce [ 'odd' ] 9
Reduce [] 15
anton@NO9LAP002:~/github/map-reduce$ node example.js
MAP a 1 -> odd
MAP c 3 -> odd
MAP d 4 -> even
MAP b 2 -> even
MAP e 5 -> odd
Reduce [ 'even' ] 6
Reduce [ 'odd' ] 9
Reduce [] 15
anton@NO9LAP002:~/github/map-reduce$ node example.js
MAP a 1 -> odd
MAP b 2 -> even
MAP d 4 -> even
MAP c 3 -> odd
MAP e 5 -> odd
Reduce [ 'even' ] 6
Reduce [ 'odd' ] 9
Reduce [] 15
Reduce [ 'even' ] 6
Reduce [ 'odd' ] 9
Reduce [] 15
Reduce [] 15
anton@NO9LAP002:~/github/map-reduce$ node example.js
MAP a 1 -> odd
MAP b 2 -> even
MAP c 3 -> odd
MAP d 4 -> even
MAP e 5 -> odd
Reduce [ 'odd' ] 9
Reduce [] 15
Reduce [ 'even' ] 6
Reduce [ 'odd' ] 9
Reduce [] 15
anton@NO9LAP002:~/github/map-reduce$ node example.js
MAP a 1 -> odd
MAP d 4 -> even
MAP c 3 -> odd
MAP b 2 -> even
MAP e 5 -> odd
Reduce [ 'even' ] 6
Reduce [] 15
Reduce [ 'odd' ] 9
Reduce [ 'even' ] 6
Reduce [] 15
anton@NO9LAP002:~/github/map-reduce$ node example.js
MAP c 3 -> odd
MAP d 4 -> even
MAP a 1 -> odd
MAP b 2 -> even
MAP e 5 -> odd
Reduce [ 'odd' ] 9
Reduce [ 'even' ] 6
Reduce [] 15
Reduce [ 'odd' ] 9
Reduce [] 15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment