Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check for unexpected sysprop query #862

Merged
merged 3 commits into from
Mar 30, 2020
Merged

check for unexpected sysprop query #862

merged 3 commits into from
Mar 30, 2020

Conversation

javeme
Copy link
Contributor

@javeme javeme commented Feb 23, 2020

fix: #861
Change-Id: Idd72a7640750c1669b95c8e30dfe053107e015d6

fix: #861
Change-Id: Idd72a7640750c1669b95c8e30dfe053107e015d6
@javeme
Copy link
Contributor Author

javeme commented Feb 23, 2020

error of EdgeCoreTest.testQueryEdgesByHasValue() with cassandra:

com.baidu.hugegraph.backend.BackendException: Failed to query [Query for EDGE where id in [] and [LABEL == 743, PROPERTIES containsv 3]]
	at com.baidu.hugegraph.backend.store.cassandra.CassandraTable.query(CassandraTable.java:113)
	at com.baidu.hugegraph.backend.store.cassandra.CassandraStore.query(CassandraStore.java:252)
	at com.baidu.hugegraph.backend.tx.AbstractTransaction.query(AbstractTransaction.java:105)
	at com.baidu.hugegraph.backend.tx.GraphTransaction.access$1(GraphTransaction.java:1)
	at com.baidu.hugegraph.backend.page.QueryList$OptimizedQuery.iterator(QueryList.java:185)
	at com.baidu.hugegraph.backend.page.QueryList.lambda$0(QueryList.java:108)
	at com.baidu.hugegraph.backend.query.QueryResults.lambda$1(QueryResults.java:162)
	at com.baidu.hugegraph.iterator.FlatMapperIterator.fetch(FlatMapperIterator.java:62)
	at com.baidu.hugegraph.iterator.WrappedIterator.hasNext(WrappedIterator.java:40)
	at com.baidu.hugegraph.iterator.FlatMapperIterator.fetch(FlatMapperIterator.java:58)
	at com.baidu.hugegraph.iterator.WrappedIterator.hasNext(WrappedIterator.java:40)
	at com.baidu.hugegraph.backend.query.QueryResults.keepInputOrderIfNeeded(QueryResults.java:94)
	at com.baidu.hugegraph.backend.tx.GraphTransaction.queryEdgesFromBackend(GraphTransaction.java:773)
	at com.baidu.hugegraph.backend.cache.CachedGraphTransaction.queryEdgesFromBackend(CachedGraphTransaction.java:195)
	at com.baidu.hugegraph.backend.tx.GraphTransaction.queryEdges(GraphTransaction.java:709)
	at com.baidu.hugegraph.HugeGraph.edges(HugeGraph.java:423)
	at com.baidu.hugegraph.traversal.optimize.HugeGraphStep.edges(HugeGraphStep.java:127)
	at com.baidu.hugegraph.traversal.optimize.HugeGraphStep.lambda$0(HugeGraphStep.java:67)
	at org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep.processNextStart(GraphStep.java:155)
	at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.next(AbstractStep.java:128)
	at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.next(AbstractStep.java:38)
	at org.apache.tinkerpop.gremlin.process.traversal.Traversal.fill(Traversal.java:180)
	at org.apache.tinkerpop.gremlin.process.traversal.Traversal.toList(Traversal.java:118)
	at com.baidu.hugegraph.core.EdgeCoreTest.testQueryEdgesByHasValue(EdgeCoreTest.java:1137)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runners.Suite.runChild(Suite.java:128)
	at org.junit.runners.Suite.runChild(Suite.java:27)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: com.datastax.driver.core.exceptions.ReadFailureException: Cassandra failure during read query at consistency LOCAL_ONE (1 responses were required but only 0 replica responded, 1 failed)
	at com.datastax.driver.core.exceptions.ReadFailureException.copy(ReadFailureException.java:130)
	at com.datastax.driver.core.exceptions.ReadFailureException.copy(ReadFailureException.java:30)
	at com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37)
	at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:245)
	at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:68)
	at com.baidu.hugegraph.backend.store.cassandra.CassandraSessionPool$Session.execute(CassandraSessionPool.java:194)
	at com.baidu.hugegraph.backend.store.cassandra.CassandraSessionPool$Session.query(CassandraSessionPool.java:190)
	at com.baidu.hugegraph.backend.store.cassandra.CassandraTable.query(CassandraTable.java:107)
	... 58 more
Caused by: com.datastax.driver.core.exceptions.ReadFailureException: Cassandra failure during read query at consistency LOCAL_ONE (1 responses were required but only 0 replica responded, 1 failed)
	at com.datastax.driver.core.exceptions.ReadFailureException.copy(ReadFailureException.java:142)
	at com.datastax.driver.core.Responses$Error.asException(Responses.java:140)
	at com.datastax.driver.core.DefaultResultSetFuture.onSet(DefaultResultSetFuture.java:179)
	at com.datastax.driver.core.RequestHandler.setFinalResult(RequestHandler.java:179)
	at com.datastax.driver.core.RequestHandler.access$2400(RequestHandler.java:49)
	at com.datastax.driver.core.RequestHandler$SpeculativeExecution.setFinalResult(RequestHandler.java:799)
	at com.datastax.driver.core.RequestHandler$SpeculativeExecution.onSet(RequestHandler.java:633)
	at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:1075)
	at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:998)
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:287)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:323)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:297)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1408)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:930)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:682)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:617)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:534)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496)
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:906)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.lang.Thread.run(Thread.java:745)
Caused by: com.datastax.driver.core.exceptions.ReadFailureException: Cassandra failure during read query at consistency LOCAL_ONE (1 responses were required but only 0 replica responded, 1 failed)
	at com.datastax.driver.core.Responses$Error$1.decode(Responses.java:88)
	at com.datastax.driver.core.Responses$Error$1.decode(Responses.java:38)
	at com.datastax.driver.core.Message$ProtocolDecoder.decode(Message.java:289)
	at com.datastax.driver.core.Message$ProtocolDecoder.decode(Message.java:269)
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:88)
	... 21 more

Actual cql statement:
SELECT * FROM g_oe WHERE LABEL=2 AND PROPERTIES CONTAINS 0x03 ALLOW FILTERING;

Seems it's a Cassandra Bug:
image

…NTAINS

Change-Id: Iac062950c62e3dd88c4894ee03ae100b145bfcaf
@codecov
Copy link

codecov bot commented Feb 25, 2020

Codecov Report

Merging #862 into master will increase coverage by 1.68%.
The diff coverage is 73.77%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #862      +/-   ##
============================================
+ Coverage     70.59%   72.28%   +1.68%     
- Complexity     4325     4512     +187     
============================================
  Files           286      287       +1     
  Lines         21084    21456     +372     
  Branches       2969     3037      +68     
============================================
+ Hits          14884    15509     +625     
+ Misses         4710     4431     -279     
- Partials       1490     1516      +26     
Impacted Files Coverage Δ Complexity Δ
...du/hugegraph/backend/tx/GraphIndexTransaction.java 80.12% <50.00%> (-0.54%) 186.00 <5.00> (+6.00) ⬇️
.../baidu/hugegraph/backend/query/ConditionQuery.java 85.90% <60.00%> (+1.08%) 98.00 <1.00> (+3.00)
...m/baidu/hugegraph/backend/tx/GraphTransaction.java 82.95% <75.00%> (+0.17%) 250.00 <10.00> (+15.00)
...du/hugegraph/traversal/optimize/TraversalUtil.java 67.14% <80.00%> (+3.69%) 84.00 <0.00> (+6.00)
...n/java/com/baidu/hugegraph/api/job/GremlinAPI.java 17.39% <0.00%> (-32.12%) 0.00% <0.00%> (ø%)
...ava/com/baidu/hugegraph/backend/page/IdHolder.java 74.35% <0.00%> (-11.36%) 1.00% <0.00%> (-12.00%)
...om/baidu/hugegraph/backend/query/QueryResults.java 79.38% <0.00%> (-7.77%) 40.00% <0.00%> (+7.00%) ⬇️
...c/main/java/com/baidu/hugegraph/HugeException.java 92.30% <0.00%> (-7.70%) 6.00% <0.00%> (+2.00%) ⬇️
...n/java/com/baidu/hugegraph/schema/VertexLabel.java 94.11% <0.00%> (-5.89%) 11.00% <0.00%> (+3.00%) ⬇️
...ugegraph/backend/page/SortByCountIdHolderList.java 88.46% <0.00%> (-5.66%) 4.00% <0.00%> (+1.00%) ⬇️
... and 67 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 145bf0c...48debc2. Read the comment docs.

@javeme
Copy link
Contributor Author

javeme commented Feb 26, 2020

TODO: string2HugeKey() disallow pass syspprop from gremlin

Change-Id: I319703286f65fd38819b2de91d7c9a18203ceafd
if (total == 1) {
/*
* Supported query:
* 1.query just by edge label
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vertex

@Linary Linary merged commit b38ca33 into master Mar 30, 2020
@Linary Linary deleted the query-by-sysprop branch March 30, 2020 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected results when querying based on system properties
3 participants