This is an automated email from the ASF dual-hosted git repository.

jermy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph.git


The following commit(s) were added to refs/heads/master by this push:
     new 7b6a4bd13 fix exception of vertex-drop with index (#2181)
7b6a4bd13 is described below

commit 7b6a4bd13652190b44f96f1901aa1fbc0a319919
Author: Simon Cheung <[email protected]>
AuthorDate: Wed Mar 29 22:35:58 2023 +0800

    fix exception of vertex-drop with index (#2181)
    
    note only the vertex with index data needs forceLoad
---
 .../main/java/org/apache/hugegraph/backend/tx/GraphTransaction.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/hugegraph-core/src/main/java/org/apache/hugegraph/backend/tx/GraphTransaction.java
 
b/hugegraph-core/src/main/java/org/apache/hugegraph/backend/tx/GraphTransaction.java
index 1a6cdcb33..42673daf4 100644
--- 
a/hugegraph-core/src/main/java/org/apache/hugegraph/backend/tx/GraphTransaction.java
+++ 
b/hugegraph-core/src/main/java/org/apache/hugegraph/backend/tx/GraphTransaction.java
@@ -689,10 +689,12 @@ public class GraphTransaction extends 
IndexableTransaction {
 
         // Override vertices in local `addedVertices`
         this.addedVertices.remove(vertex.id());
-
+        // Force load vertex to ensure all properties are loaded (refer to 
#2181)
+        if (vertex.schemaLabel().indexLabels().size() > 0)  {
+            vertex.forceLoad();
+        }
         // Collect the removed vertex
         this.removedVertices.put(vertex.id(), vertex);
-
         this.afterWrite();
     }
 

Reply via email to