Github user arunmahadevan commented on a diff in the pull request:
https://github.com/apache/storm/pull/1866#discussion_r95326528
--- Diff: storm-core/src/jvm/org/apache/storm/daemon/nimbus/Nimbus.java ---
@@ -3600,7 +3600,7 @@ public ComponentPageInfo getComponentPageInfo(String
topoId, String componentId,
List<Integer> tasks =
compToTasks.get(StormCommon.EVENTLOGGER_COMPONENT_ID);
tasks.sort(null);
// Find the task the events from this component route to.
- int taskIndex =
TupleUtils.listHashCode(Arrays.asList(componentId)) %
+ int taskIndex =
(TupleUtils.listHashCode(Arrays.asList(componentId)) % tasks.size() +
tasks.size()) %
--- End diff --
This should match the task selected by fields grouping
https://github.com/apache/storm/blob/master/storm-core/src/jvm/org/apache/storm/daemon/GrouperFactory.java#L159.
The modulo technique will return a different value than Math.abs. Probably
we should move it to some common utility function and use it in both places.
In 1.x branch the fields grouper doesn't seem to account for negative
hashCode, so not sure why didn't it come up before.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---