basho/riak_kv — Issue #284: JS Map-only MapReduce returns partial results when some VMs are busy
Author: ian-plosker
Created: 2012-02-08 16:50:12+00:00
State: open

To reproduce this issue do the following:

1\. `make devrel`
2\. Set `map_js_vm_count` to 0 on one node
3\. Issue the following puts:

```bash
curl -XPUT http://localhost:8091/riak/docs/foo \
-H 'Content-Type: text/plain' -d 'demo data goes here' -v
curl -XPUT http://localhost:8091/riak/docs/bar \
-H 'Content-Type: text/plain' -d 'demo demo demo demo' -v
curl -XPUT http://localhost:8091/riak/docs/baz \
-H 'Content-Type: text/plain' -d 'nothing to see here' -v
curl -XPUT http://localhost:8091/riak/docs/qux \
-H 'Content-Type: text/plain' -d 'demo demo' -v
```

4\. Issue the following MapReduce job:

```bash
curl -XPOST http://localhost:8091/mapred \
-H 'Content-Type: application/json' \
-d '{"inputs":"docs",
"query":[{"map":{"language":"javascript",
"source":"Riak.mapValues"}}]}'
```

Only a partial result set will be returned. For example:

```bash
["demo demo demo demo","demo data goes here","demo demo"]
```

You should get:

```bash
["demo demo demo demo","demo data goes here","demo demo","nothing to see here"]
```

In the logs you will see notifications like this:

```bash
2012-02-07 12:38:36.700 [notice] <0.26723.1821>@riak_kv_js_manager:blocking_dispatch:246 JS call failed: All VMs are busy.
```