incubator-hugegraph
incubator-hugegraph copied to clipboard
Gremlin 同步 POST 查询接口报错
Expected behavior 期望表现
使用 Gremlin POST 接口进行 Gremlin 查询,得到对应语句的输出。
Actual behavior 实际表现
2019-04-18 19:19:57 552372833 [gremlin-server-exec-22] [WARN ] org.apache.tinkerpop.gremlin.server.handler.HttpGremlinEndpointHandler [] - Invalid request - responding with 500 Internal Server Error and Not found key 'NAME' from entry 0x00c3: [�=~task, �
={}, �
=, �2=, �3=
������������, �4=, �5=�, �6=�����, �7=]
java.lang.IllegalStateException: Not found key 'NAME' from entry 0x00c3: [�=~task, �
={}, �
=, �2=, �3=
������������, �4=, �5=�, �6=�����, �7=]
at com.google.common.base.Preconditions.checkState(Preconditions.java:199) ~[guava-19.0.jar:?]
at com.baidu.hugegraph.util.E.checkState(E.java:68) ~[hugegraph-common-1.5.6.jar:1.5.6.0]
at com.baidu.hugegraph.backend.serializer.BinarySerializer$SchemaSerializer.column(BinarySerializer.java:1134) ~[hugegraph-core-0.9.1.jar:0.9.1.0]
at com.baidu.hugegraph.backend.serializer.BinarySerializer$SchemaSerializer.readString(BinarySerializer.java:1048) ~[hugegraph-core-0.9.1.jar:0.9.1.0]
at com.baidu.hugegraph.backend.serializer.BinarySerializer$SchemaSerializer.readVertexLabel(BinarySerializer.java:917) ~[hugegraph-core-0.9.1.jar:0.9.1.0]
at com.baidu.hugegraph.backend.serializer.BinarySerializer.readVertexLabel(BinarySerializer.java:838) ~[hugegraph-core-0.9.1.jar:0.9.1.0]
at com.baidu.hugegraph.backend.tx.SchemaTransaction.deserialize(SchemaTransaction.java:364) ~[hugegraph-core-0.9.1.jar:0.9.1.0]
at com.baidu.hugegraph.backend.tx.SchemaTransaction.getAllSchema(SchemaTransaction.java:320) ~[hugegraph-core-0.9.1.jar:0.9.1.0]
at com.baidu.hugegraph.backend.cache.CachedSchemaTransaction.getAllSchema(CachedSchemaTransaction.java:254) ~[hugegraph-core-0.9.1.jar:0.9.1.0]
at com.baidu.hugegraph.backend.tx.SchemaTransaction.getVertexLabels(SchemaTransaction.java:97) ~[hugegraph-core-0.9.1.jar:0.9.1.0]
at com.baidu.hugegraph.backend.tx.GraphIndexTransaction.collectMatchedIndexes(GraphIndexTransaction.java:461) ~[hugegraph-core-0.9.1.jar:0.9.1.0]
at com.baidu.hugegraph.backend.tx.GraphIndexTransaction.queryByUserprop(GraphIndexTransaction.java:304) ~[hugegraph-core-0.9.1.jar:0.9.1.0]
at com.baidu.hugegraph.backend.tx.GraphIndexTransaction.indexQuery(GraphIndexTransaction.java:255) ~[hugegraph-core-0.9.1.jar:0.9.1.0]
at com.baidu.hugegraph.backend.tx.GraphTransaction.optimizeQuery(GraphTransaction.java:1029) ~[hugegraph-core-0.9.1.jar:0.9.1.0]
at com.baidu.hugegraph.backend.tx.GraphTransaction.query(GraphTransaction.java:318) ~[hugegraph-core-0.9.1.jar:0.9.1.0]
at com.baidu.hugegraph.backend.tx.GraphTransaction.queryVerticesFromBackend(GraphTransaction.java:506) ~[hugegraph-core-0.9.1.jar:0.9.1.0]
at com.baidu.hugegraph.backend.cache.CachedGraphTransaction.queryVerticesFromBackend(CachedGraphTransaction.java:76) ~[hugegraph-core-0.9.1.jar:0.9.1.0]
at com.baidu.hugegraph.backend.tx.GraphTransaction.queryVertices(GraphTransaction.java:480) ~[hugegraph-core-0.9.1.jar:0.9.1.0]
at com.baidu.hugegraph.HugeGraph.vertices(HugeGraph.java:381) ~[hugegraph-core-0.9.1.jar:0.9.1.0]
at com.baidu.hugegraph.traversal.optimize.HugeGraphStep.vertices(HugeGraphStep.java:94) ~[hugegraph-core-0.9.1.jar:0.9.1.0]
at com.baidu.hugegraph.traversal.optimize.HugeGraphStep.lambda$new$0(HugeGraphStep.java:66) ~[hugegraph-core-0.9.1.jar:0.9.1.0]
at org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep.processNextStart(GraphStep.java:139) ~[gremlin-core-3.2.5.jar:3.2.5]
at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143) ~[gremlin-core-3.2.5.jar:3.2.5]
at org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.next(ExpandableStepIterator.java:50) ~[gremlin-core-3.2.5.jar:3.2.5]
at org.apache.tinkerpop.gremlin.process.traversal.step.map.FlatMapStep.processNextStart(FlatMapStep.java:48) ~[gremlin-core-3.2.5.jar:3.2.5]
at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143) ~[gremlin-core-3.2.5.jar:3.2.5]
at org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.next(ExpandableStepIterator.java:50) ~[gremlin-core-3.2.5.jar:3.2.5]
at org.apache.tinkerpop.gremlin.process.traversal.step.map.MapStep.processNextStart(MapStep.java:36) ~[gremlin-core-3.2.5.jar:3.2.5]
at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143) ~[gremlin-core-3.2.5.jar:3.2.5]
at org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.hasNext(DefaultTraversal.java:192) ~[gremlin-core-3.2.5.jar:3.2.5]
at org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils.fill(IteratorUtils.java:62) ~[gremlin-core-3.2.5.jar:3.2.5]
at org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils.list(IteratorUtils.java:85) ~[gremlin-core-3.2.5.jar:3.2.5]
at org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils.asList(IteratorUtils.java:382) ~[gremlin-core-3.2.5.jar:3.2.5]
at org.apache.tinkerpop.gremlin.server.handler.HttpGremlinEndpointHandler.lambda$channelRead$1(HttpGremlinEndpointHandler.java:239) ~[gremlin-server-3.2.5.jar:3.2.5]
at org.apache.tinkerpop.gremlin.util.function.FunctionUtils.lambda$wrapFunction$0(FunctionUtils.java:36) ~[gremlin-core-3.2.5.jar:3.2.5]
at org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.lambda$eval$2(GremlinExecutor.java:320) ~[gremlin-groovy-3.2.5.jar:3.2.5]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_181]
at com.baidu.hugegraph.auth.HugeGraphAuthProxy$ContextTask.run(HugeGraphAuthProxy.java:282) [hugegraph-api-0.9.1.jar:0.32.0.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_181]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_181]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]
抛出的异常中也出现了乱码,除了 gremlin 接口,其他接口没有问题,如
GET http://localhost:8080/graphs/hugegraph/graph/vertices?page&limit=3
Steps to reproduce the problem 复现步骤
目测是我之前用最新的master 版本重新 init 了一下 RocksDB 库,造成了数据被污染,结果用老版本的 HugeGraphServer 查这份数据就报了这样的错误,不知道分析的对不对。
Status of loaded data 数据状态
Vertex/Edge summary 数据量
100多万结点,300多万边。
Vertex/Edge example 数据示例
{
"vertices": [
{
"id": "3:6",
"label": "placeothers",
"type": "vertex",
"properties": {
"中文名": [
{
"id": "3:6>中文名",
"value": "山西财经大学区域经济研究所"
}
],
"name": [
{
"id": "3:6>name",
"value": "山西财经大学区域经济研究所"
}
],
"地理位置": [
{
"id": "3:6>地理位置",
"value": "山西财经大学坞城校区育才楼3层"
}
],
"创建时间": [
{
"id": "3:6>创建时间",
"value": "2007"
}
],
"id": [
{
"id": "3:6>id",
"value": 6
}
],
"class": [
{
"id": "3:6>class",
"value": "PlaceOthers"
}
]
}
}
],
"page": "AAaCNDowZsgAAAAA"
}
Schema(VertexLabel, EdgeLabel, IndexLabel) 元数据结构
百科类图谱,有人物、学校、电影等众多节点和关系。
Property key 中有 name 属性:
{
"id": 9,
"name": "name",
"data_type": "TEXT",
"cardinality": "SINGLE",
"properties": [],
"user_data": {}
}
Specifications of environment 环境信息
HugeGraph-0.9.1 master release Operating System: debian 8 Hugegraph Backend: rocksDB
@suesunss 确实很可能是 sevrer 和数据不兼容导致的,hugegraph 目前不保证兼容以前的版本,所以如果可能的话,请在不混用 server 和数据情况下再测试一下。
@Linary 嗯嗯,感谢反馈。