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 <[email protected]> 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,
