[ https://issues.apache.org/jira/browse/TINKERPOP-1379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15386177#comment-15386177 ]
ASF GitHub Bot commented on TINKERPOP-1379: ------------------------------------------- GitHub user pluradj opened a pull request: https://github.com/apache/tinkerpop/pull/363 TINKERPOP-1379 remove excess bulk in tail buffer https://issues.apache.org/jira/browse/TINKERPOP-1379 You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-1379 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/363.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #363 ---- commit d43db2bb2f3f4988503f0cdedbd1877cd542c502 Author: Jason Plurad <plur...@us.ibm.com> Date: 2016-07-20T16:31:53Z remove excess bulk in tail buffer ---- > unaccounted excess in TailGlobalStep > ------------------------------------ > > Key: TINKERPOP-1379 > URL: https://issues.apache.org/jira/browse/TINKERPOP-1379 > Project: TinkerPop > Issue Type: Bug > Components: process > Affects Versions: 3.2.1 > Reporter: Jason Plurad > > https://github.com/apache/tinkerpop/blob/master/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/TailGlobalStep.java#L71-L74 > This code doesn't account for the excess removed from {{tailBulk}}. This can > cause the code to set incorrect bulk values when there are multiple > traversers in the tail buffer. > I observed this behavior intermittently in TitanGraph > (https://github.com/thinkaurelius/titan/pull/1312), which doesn't allow user > defined ids, so the ordering of the traversers in the TraverserSet is a lot > more random than the unit tests using TinkerGraph. > This issue is reproducible with TinkerGraph (master/3.2.1). Instead of > loading from one of the data files, manually create the graph with the ids in > inverted order. > {noformat} > graph = TinkerGraph.open(); > // graph.io(IoCore.gryo()).readGraph("tinkerpop-modern.kryo"); > final Vertex v1 = graph.addVertex(T.id, 6L, T.label, "person", "name", > "marko", "age", 29); > final Vertex v2 = graph.addVertex(T.id, 5L, T.label, "person", "name", > "vadas", "age", 27); > final Vertex v3 = graph.addVertex(T.id, 4L, T.label, "software", "name", > "lop", "lang", "java"); > final Vertex v4 = graph.addVertex(T.id, 3L, T.label, "person", "name", > "josh", "age", 32); > final Vertex v5 = graph.addVertex(T.id, 2L, T.label, "software", "name", > "ripple", "lang", "java"); > final Vertex v6 = graph.addVertex(T.id, 1L, T.label, "person", "name", > "peter", "age", 35); > v1.addEdge("knows", v2, "weight", 0.5d); > v1.addEdge("knows", v4, "weight", 1.0d); > v1.addEdge("created", v2, "weight", 0.4d); > v4.addEdge("knows", v5, "weight", 1.0d); > v4.addEdge("knows", v3, "weight", 0.4d); > v6.addEdge("knows", v3, "weight", 0.2d); > if (graph.features().graph().supportsTransactions()) graph.tx().commit(); > final GraphTraversalSource g = graph.traversal(); > String result = > g.V().repeat(both()).times(3).tail(7).count().next().toString(); > boolean success = "7".equals(result); > {noformat} > The fix is this: > {noformat} > if (excess > 0) { > oldest.setBulk(oldestBulk-excess); > // Account for the loss of excess in the tail buffer > this.tailBulk -= excess; > } > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)