[ 
https://issues.apache.org/jira/browse/TINKERPOP-3295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18144086#comment-18144086
 ] 

ASF GitHub Bot commented on TINKERPOP-3295:
-------------------------------------------

Cole-Greer commented on code in PR #3802:
URL: https://github.com/apache/tinkerpop/pull/3802#discussion_r4558124054


##########
docs/src/upgrade/release-3.7.x.asciidoc:
##########
@@ -31,6 +31,52 @@ image::gremlin-zamfir.png[width=185]
 Please see the 
link:https://github.com/apache/tinkerpop/blob/3.7.8/CHANGELOG.asciidoc#release-3-7-8[changelog]
 for a
 complete list of all the modifications that are part of this release.
 
+=== Upgrading for Users
+
+==== Mutating Steps and Bulked Traversers
+
+Gremlin combines traversers that hold the same value into a single traverser 
with a bulk count. This happens for
+duplicate values given to `inject()`, after `barrier()` and after the barriers 
that `LazyBarrierStrategy` adds
+automatically. The `addV()`, `addE()`, `mergeV()`, `mergeE()` and `property()` 
steps now perform their write once for
+every traverser that a bulked traverser represents, so the number of mutations 
no longer depends on whether
+traversers happened to be bulked.
+
+[source,groovy]
+----
+// 3.7.7
+gremlin> g.inject(1, 1).addV('person').id()
+==>0
+==>0
+gremlin> g.V().count()
+==>1
+
+// 3.7.8
+gremlin> g.inject(1, 1).addV('person').id()
+==>0
+==>1
+gremlin> g.V().count()
+==>2
+----
+
+Traversals that write from duplicate traversers may now create more elements, 
apply `onMatch` where it was skipped
+before, add more `list` cardinality values, or raise an error for a reused 
user supplied `T.id`. Such traversals
+should be reviewed if they depended on the previous counts. Mutations made 
inside the child traversals of steps such
+as `map()`, `sideEffect()` and `coalesce()` still occur once per bulked 
traverser.
+
+See: link:https://issues.apache.org/jira/browse/TINKERPOP-3295[TINKERPOP-3295]
+
+=== Upgrading for Providers
+
+==== Graph System Providers
+
+===== Mutating Steps and Bulked Traversers
+
+Providers that replace `AddVertexStep`, `AddEdgeStep`, `MergeVertexStep`, 
`MergeEdgeStep` or `AddPropertyStep` with
+their own implementations should perform the mutation once for each unit of a 
traverser's bulk. New Gherkin tests in
+the `AddVertex`, `AddEdge`, `MergeVertex` and `MergeEdge` features validate 
this behavior.

Review Comment:
   Nit: I don't think a dedicated callout to providers is needed here, as this 
is mostly a bug fix on our end. If any provider happens to have replicated our 
bug, the above examples and new feature tests should be all they need.





> inject() and addV() has bulking issues
> --------------------------------------
>
>                 Key: TINKERPOP-3295
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-3295
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: process
>    Affects Versions: 3.7.7
>            Reporter: Stephen Mallette
>            Priority: Critical
>
> {code}
>   gremlin> g.inject(1,1).addV('X').id()
>   ==>0
>   ==>0
>   gremlin> g.V().count()
>   ==>1
> {code}
> the example is for {{addV()}} and the {{inject()}} start step but 
> investigation should probably cover other variations of mutations like, 
> {{addE()}}, {{mergeV/E()}} and {{drop()}} and steps and mid-traversal 
> {{inject()}}.
> Should also cover cases like: {{g.inject(1, 1).addV('X').property(T.id, 
> 'same')}}



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to