prabhatbhattarai / project-voldemort

Automatically exported from code.google.com/p/project-voldemort
Apache License 2.0
0 stars 0 forks source link

getAll is broken for stores that use zone-routing #367

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
If you have a store that uses zone-routing calls to getAll() will end up going 
to all zones irrespective of the zone-routing settings and client-zone-id.

getAll requests should be satisfied from the local client zone where possible 
and only go to foreign zones as a last resort.

This problem exists in the current release (0.90).

The following diff should fix this bug:

src/java/voldemort/store/routed/action/PerformParallelGetAllRequests.java
@@ -154,6 +154,7 @@ public class PerformParallelGetAllRequests
                         zoneResponses = pipelineData.getKeyToZoneResponse().get(key);
                     } else {
                         zoneResponses = new HashSet<Integer>();
+                        pipelineData.getKeyToZoneResponse().put( key, 
zoneResponses );
                     }
                     zoneResponses.add(response.getNode().getZoneId());
                 }
src/java/voldemort/store/routed/action/PerformSerialGetAllRequests.java
@@ -132,6 +132,7 @@ public class PerformSerialGetAllRequests
                         zoneResponses = pipelineData.getKeyToZoneResponse().get(key);
                     } else {
                         zoneResponses = new HashSet<Integer>();
+                        pipelineData.getKeyToZoneResponse().put( key, 
zoneResponses );
                     }
                     zoneResponses.add(response.getNode().getZoneId());

Original issue reported on code.google.com by neale.pa...@gmail.com on 24 Oct 2011 at 10:27