You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hugegraph.apache.org by vg...@apache.org on 2024/01/21 07:25:53 UTC

(incubator-hugegraph) branch fix-hstore-ci created (now 0bdcf1ba5)

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

vgalaxies pushed a change to branch fix-hstore-ci
in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph.git


      at 0bdcf1ba5 chore: some fix

This branch includes the following new commits:

     new 0bdcf1ba5 chore: some fix

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(incubator-hugegraph) 01/01: chore: some fix

Posted by vg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

vgalaxies pushed a commit to branch fix-hstore-ci
in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph.git

commit 0bdcf1ba5a45176f5146ff9d3aba4ea1800a5719
Author: VGalaxies <vg...@apache.org>
AuthorDate: Sun Jan 21 15:25:02 2024 +0800

    chore: some fix
---
 .../backend/serializer/BinarySerializer.java       |  6 ++++--
 .../hugegraph/backend/tx/SchemaTransactionV2.java  | 24 +++++++++++++++++++++-
 2 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/serializer/BinarySerializer.java b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/serializer/BinarySerializer.java
index 0a4c9461a..3935cd5d2 100644
--- a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/serializer/BinarySerializer.java
+++ b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/serializer/BinarySerializer.java
@@ -924,8 +924,10 @@ public class BinarySerializer extends AbstractSerializer {
              * the page to id and use it as the starting row for this query
              */
             byte[] position = PageState.fromString(query.page()).position();
-            E.checkArgument(Bytes.compare(position, prefix.asBytes()) >= 0,
-                            "Invalid page out of lower bound");
+            // FIXME: Due to the inconsistency in the definition of the position of the RocksDB
+            //  scan iterator and Hstore, temporarily remove the following check.
+            // E.checkArgument(Bytes.compare(position, prefix.asBytes()) >= 0,
+            //                "Invalid page out of lower bound");
             BinaryId start = new BinaryId(position, null);
             newQuery = new IdPrefixQuery(query, start, prefix);
         } else {
diff --git a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/tx/SchemaTransactionV2.java b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/tx/SchemaTransactionV2.java
index 408195f82..c199cfa12 100644
--- a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/tx/SchemaTransactionV2.java
+++ b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/tx/SchemaTransactionV2.java
@@ -288,7 +288,7 @@ public class SchemaTransactionV2 implements ISchemaTransaction {
          */
         LOG.debug("SchemaTransaction remove edge label '{}'", id);
         EdgeLabel schema = this.getEdgeLabel(id);
-        // TODO: uncomment later - el
+        // TODO: uncomment later - sub edge labels
         //if (schema.edgeLabelType().parent()) {
         //    List<EdgeLabel> edgeLabels = this.getEdgeLabels();
         //    for (EdgeLabel edgeLabel : edgeLabels) {
@@ -375,7 +375,29 @@ public class SchemaTransactionV2 implements ISchemaTransaction {
 
     @Override
     public void removeIndexLabelFromBaseLabel(IndexLabel indexLabel) {
+        HugeType baseType = indexLabel.baseType();
+        Id baseValue = indexLabel.baseValue();
+        SchemaLabel baseLabel;
+        if (baseType == HugeType.VERTEX_LABEL) {
+            baseLabel = this.getVertexLabel(baseValue);
+        } else {
+            assert baseType == HugeType.EDGE_LABEL;
+            baseLabel = this.getEdgeLabel(baseValue);
+        }
 
+        if (baseLabel == null) {
+            LOG.info("The base label '{}' of index label '{}' " +
+                "may be deleted before", baseValue, indexLabel);
+            return;
+        }
+        if (baseLabel.equals(VertexLabel.OLAP_VL)) {
+            return;
+        }
+
+        this.updateSchema(baseLabel, schema -> {
+            // NOTE: Do schema update in the lock block
+            baseLabel.removeIndexLabel(indexLabel.id());
+        });
     }
 
     protected void updateSchema(SchemaElement schema,