[
https://issues.apache.org/jira/browse/TINKERPOP-1393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15404151#comment-15404151
]
Dan LaRocque commented on TINKERPOP-1393:
-----------------------------------------
Thanks for pointing me at that issue. It looks like we may have even followed
the same crumb trail ({{"String result =
g.V().repeat(both()).times(3).tail(7).count().next().toString();"}}). I don't
understand the relevant code well enough to comment on the fix right now, but
it definitely looks like the problem statements overlap. I'll link this as a
duplicate of your issue and close it.
> RepeatUnrollStrategy alters traversal behavior
> ----------------------------------------------
>
> Key: TINKERPOP-1393
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1393
> Project: TinkerPop
> Issue Type: Bug
> Affects Versions: 3.2.1
> Reporter: Dan LaRocque
>
> I think
> https://github.com/apache/tinkerpop/commit/6208b90b2ca297186b4f75f356e0093d4b6ed280
> may contain a bug.
> Consider this normal-looking gremlin-console session from the immediately
> preceding commit (not 6208b but the commit right before):
> {noformat}
> tinkerpop$ git checkout 6208b90b2ca297186b4f75f356e0093d4b6ed280~
> tinkerpop$ mvn clean install -DskipTests=true
> tinkerpop$ gremlin-console/bin/gremlin.sh
> \,,,/
> (o o)
> -----oOOo-(3)-oOOo-----
> plugin activated: tinkerpop.server
> plugin activated: tinkerpop.utilities
> plugin activated: tinkerpop.tinkergraph
> gremlin> tg = TinkerGraph.open()
> ==>tinkergraph[vertices:0 edges:0]
> gremlin> ego = tg.addVertex('vertex')
> ==>v[0]
> gremlin> p1 = tg.addVertex('vertex')
> ==>v[1]
> gremlin> p2 = tg.addVertex('vertex')
> ==>v[2]
> gremlin> p3 = tg.addVertex('vertex')
> ==>v[3]
> gremlin> ego.addEdge('knows', p1)
> ==>e[4][0-knows->1]
> gremlin> ego.addEdge('knows', p2)
> ==>e[5][0-knows->2]
> gremlin> ego.addEdge('knows', p3)
> ==>e[6][0-knows->3]
> gremlin> tg.traversal().V().repeat(both()).times(3).tail(7)
> ==>v[0]
> ==>v[0]
> ==>v[0]
> ==>v[0]
> ==>v[0]
> ==>v[0]
> ==>v[0]
> gremlin> tg.traversal().V().both().both().both().count()
> ==>18
> gremlin> tg.traversal().V().repeat(both()).times(3).tail(7).count()
> ==>7
> gremlin>
> {noformat}
> So far so good.
> However, 6208b changes the last traversal result from 7 to 6:
> {noformat}
> tinkerpop$ git checkout 6208b90b2ca297186b4f75f356e0093d4b6ed280
> tinkerpop$ mvn clean install -DskipTests=true
> tinkerpop$ gremlin-console/bin/gremlin.sh
> \,,,/
> (o o)
> -----oOOo-(3)-oOOo-----
> plugin activated: tinkerpop.server
> plugin activated: tinkerpop.utilities
> plugin activated: tinkerpop.tinkergraph
> gremlin> tg = TinkerGraph.open()
> ==>tinkergraph[vertices:0 edges:0]
> gremlin> ego = tg.addVertex('vertex')
> ==>v[0]
> gremlin> p1 = tg.addVertex('vertex')
> ==>v[1]
> gremlin> p2 = tg.addVertex('vertex')
> ==>v[2]
> gremlin> p3 = tg.addVertex('vertex')
> ==>v[3]
> gremlin> ego.addEdge('knows', p1)
> ==>e[4][0-knows->1]
> gremlin> ego.addEdge('knows', p2)
> ==>e[5][0-knows->2]
> gremlin> ego.addEdge('knows', p3)
> ==>e[6][0-knows->3]
> gremlin> tg.traversal().V().repeat(both()).times(3).tail(7)
> ==>v[0]
> ==>v[0]
> ==>v[0]
> ==>v[0]
> ==>v[0]
> ==>v[0]
> gremlin> tg.traversal().V().both().both().both().count()
> ==>18
> gremlin> tg.traversal().V().repeat(both()).times(3).tail(7).count()
> ==>6
> {noformat}
> Confusingly, {{mvn -pl tinkergraph-gremlin
> -Dtest=TinkerGraphProcessStandardTest clean verify}} passes. That test
> includes {{TailTest$Traversals.g_V_repeatXbothX_timesX3X_tailX7X}}, which
> seems like it would catch this kind of bug, but said test succeeds.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)