Chat-Wane / sage-jena

Sage ⨯ Jena: Sage on top of Jena.
Apache License 2.0
1 stars 1 forks source link

Preempt `query_10078` fails on timeout 1ms #14

Closed Chat-Wane closed 1 year ago

Chat-Wane commented 1 year ago

The first run (slower) does not report the same number of results as the second (faster). The true number of results is 3932428.

There is a mistake in preemptive queries that need to be investigated. Possibly an issue with fully bounded triple as last BGP of the query.

SELECT ?v7 ?v1 ?v0 ?v4 ?v2 ?v6 ?v3 ?v8 WHERE {
    ?v1 <http://schema.org/priceValidUntil> ?v8.
    ?v1 <http://purl.org/goodrelations/validFrom> ?v2.
    ?v1 <http://purl.org/goodrelations/validThrough> ?v3.
    ?v1 <http://schema.org/eligibleQuantity> ?v6.
    ?v0 <http://purl.org/goodrelations/offers> ?v1.
    ?v1 <http://schema.org/eligibleRegion> ?v7.
    ?v4 <http://schema.org/nationality> ?v7.
    ?v4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://db.uwaterloo.ca/~galuc/wsdbm/Role1>.
}
[fr.gdd.sage.WatdivBenchmark.execute-jmh-worker-1] DEBUG fr.gdd.sage.WatdivBenchmark - Got 3932428 results for this query in 7526 pause/resume.
17,227 s/op
# Warmup Iteration   2: <failure>

java.lang.Exception: /!\ not the same number of results on sage-jena-benchmarks/queries/watdiv_with_sage_plan/query_10078.sparql: 3932428 vs 3932328.
    at fr.gdd.sage.WatdivBenchmark.execute(WatdivBenchmark.java:75)
    at fr.gdd.sage.jmh_generated.WatdivBenchmark_execute_jmhTest.execute_ss_jmhStub(WatdivBenchmark_execute_jmhTest.java:433)
    at fr.gdd.sage.jmh_generated.WatdivBenchmark_execute_jmhTest.execute_SingleShotTime(WatdivBenchmark_execute_jmhTest.java:385)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
    at java.base/java.lang.reflect.Method.invoke(Method.java:578)
    at org.openjdk.jmh.runner.BenchmarkHandler$BenchmarkTask.call(BenchmarkHandler.java:475)
    at org.openjdk.jmh.runner.BenchmarkHandler$BenchmarkTask.call(BenchmarkHandler.java:458)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:577)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.lang.Thread.run(Thread.java:1589)
Chat-Wane commented 1 year ago

Did not manage to reproduce the bug, even with lowest possible timeout, even on a lot of runs...

[fr.gdd.sage.WatdivBenchmark.execute-jmh-worker-1] DEBUG fr.gdd.sage.WatdivBenchmark - Got 3932428 results for this query in 29471067 pause/resume.
(benchmark timed out, interrupted 1738 times) 791,915 s/op
Iteration   1: (benchmark timed out, interrupted 1755 times) 794,535 s/op
[fr.gdd.sage.WatdivBenchmark.execute-jmh-worker-1] DEBUG fr.gdd.sage.WatdivBenchmark - Got 3932428 results for this query in 29471067 pause/resume.

Did not fail on test with vpv . spo...

Maybe a bug with wrapped NullIterator ?

Chat-Wane commented 1 year ago

Also a rare bug with the query when trying to solve this one:

java.util.NoSuchElementException: NullIterator.next
    at org.apache.jena.atlas.iterator.NullIterator.next(NullIterator.java:37)
    at org.apache.jena.atlas.iterator.Iter.next(Iter.java:1109)
    at org.apache.jena.dboe.trans.bplustree.PreemptJenaIterator.next(PreemptJenaIterator.java:172)
    at org.apache.jena.dboe.trans.bplustree.PreemptJenaIterator.skip(PreemptJenaIterator.java:151)
    at org.apache.jena.dboe.trans.bplustree.PreemptJenaIterator.skip(PreemptJenaIterator.java:27)
    at fr.gdd.sage.arq.VolcanoIteratorTupleId.skip(VolcanoIteratorTupleId.java:65)
    at fr.gdd.sage.arq.VolcanoIteratorFactory.getScan(VolcanoIteratorFactory.java:102)
    at org.apache.jena.tdb2.solver.PreemptStageMatchTuple.access(PreemptStageMatchTuple.java:49)
    at org.apache.jena.tdb2.solver.PreemptStageMatchTuple.lambda$access$0(PreemptStageMatchTuple.java:31)
    at org.apache.jena.atlas.iterator.IteratorFlatMap.hasNext(IteratorFlatMap.java:55)
    at org.apache.jena.sparql.engine.iterator.IterAbortable.hasNext(IterAbortable.java:59)
    at org.apache.jena.atlas.iterator.IteratorFlatMap.hasNext(IteratorFlatMap.java:53)
    at org.apache.jena.sparql.engine.iterator.IterAbortable.hasNext(IterAbortable.java:59)
    at org.apache.jena.atlas.iterator.Iter$IterMap.hasNext(Iter.java:412)
    at org.apache.jena.sparql.engine.iterator.QueryIterPlainWrapper.hasNextBinding(QueryIterPlainWrapper.java:59)
    at org.apache.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:116)
    at org.apache.jena.sparql.engine.iterator.QueryIterConvert.hasNextBinding(QueryIterConvert.java:58)
    at org.apache.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:116)
    at org.apache.jena.sparql.engine.iterator.PreemptCounterIter.hasNextBinding(PreemptCounterIter.java:33)
    at org.apache.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:116)
    at org.apache.jena.sparql.engine.iterator.QueryIteratorWrapper.hasNextBinding(QueryIteratorWrapper.java:38)
    at org.apache.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:116)
    at org.apache.jena.sparql.engine.iterator.QueryIteratorWrapper.hasNextBinding(QueryIteratorWrapper.java:38)
    at org.apache.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:116)
    at org.apache.jena.sparql.exec.RowSetStream.hasNext(RowSetStream.java:47)
    at org.apache.jena.sparql.engine.ResultSetStream.hasNext(ResultSetStream.java:81)
    at fr.gdd.sage.ExecuteUtils.executeQueryTillTheEnd(ExecuteUtils.java:67)
    at fr.gdd.sage.ExecuteUtils.executeTillTheEnd(ExecuteUtils.java:85)
    at fr.gdd.sage.SetupBenchmark.execute(SetupBenchmark.java:137)
    at fr.gdd.sage.WatdivBenchmark.execute(WatdivBenchmark.java:69)
    at fr.gdd.sage.jmh_generated.WatdivBenchmark_execute_jmhTest.execute_ss_jmhStub(WatdivBenchmark_execute_jmhTest.java:433)
    at fr.gdd.sage.jmh_generated.WatdivBenchmark_execute_jmhTest.execute_SingleShotTime(WatdivBenchmark_execute_jmhTest.java:385)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
    at java.base/java.lang.reflect.Method.invoke(Method.java:578)
    at org.openjdk.jmh.runner.BenchmarkHandler$BenchmarkTask.call(BenchmarkHandler.java:475)
    at org.openjdk.jmh.runner.BenchmarkHandler$BenchmarkTask.call(BenchmarkHandler.java:458)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:577)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.lang.Thread.run(Thread.java:1589)