You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by knowak <ka...@gmail.com> on 2016/03/22 00:08:18 UTC

SpiQuery fails with exception

Hi,
 
We’ve setup custom IndexSpi but when trying to run SpiQuery exception below
shows up. Is there anything we’re missing?
Worth adding that after excluding this validation for SPI queries (at
GridCacheQueryManager.java:663) all seem to be working as expected. Ignite
version - 1.5.0.final.
 

class org.apache.ignite.IgniteCheckedException: Received next page request
after iterator was removed. Consider increasing maximum number of stored
iterators (see GridCacheConfiguration.getMaximumQueryIteratorCount()
configuration property).
    at
org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager.executeFieldsQuery(GridCacheQueryManager.java:666)
    at
org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager.fieldsQueryResult(GridCacheQueryManager.java:1818)
    at
org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager.fieldsQueryResult(GridCacheQueryManager.java:1784)
    at
org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager.runFieldsQuery(GridCacheQueryManager.java:1194)
    at
org.apache.ignite.internal.processors.cache.query.GridCacheDistributedQueryManager.processQueryRequest(GridCacheDistributedQueryManager.java:225)
    at
org.apache.ignite.internal.processors.cache.query.GridCacheDistributedQueryManager$2.apply(GridCacheDistributedQueryManager.java:105)
    at
org.apache.ignite.internal.processors.cache.query.GridCacheDistributedQueryManager$2.apply(GridCacheDistributedQueryManager.java:103)
    at
org.apache.ignite.internal.processors.cache.GridCacheIoManager.processMessage(GridCacheIoManager.java:582)
    at
org.apache.ignite.internal.processors.cache.GridCacheIoManager.onMessage0(GridCacheIoManager.java:280)
    (…)

 
Thanks,
Kamil



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/SpiQuery-fails-with-exception-tp3615.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: SpiQuery fails with exception

Posted by knowak <ka...@gmail.com>.
Added, thanks

Kamil



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/SpiQuery-fails-with-exception-tp3615p3646.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: SpiQuery fails with exception

Posted by vkulichenko <va...@gmail.com>.
Kamil,

Can you please share your thoughts in the ticket?

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/SpiQuery-fails-with-exception-tp3615p3627.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: SpiQuery fails with exception

Posted by knowak <ka...@gmail.com>.
Hi Val -

There are a few more potential issues we noticed when using Spi indexing in
1.5.0.final:

- method query() in IndexingSpi interface returns
Iterator<Cache.Entry&lt;?,?>> but elements of type Map.Entry are expected
further down the stack (i.e. in IgniteCacheProxy:528). We had to create type
that extends both Map.Entry and Cache.Entry to get it working.

- when IndexingSpi.store() throws an exception on commit, error is not
propagated to a client node and transaction ends up with state COMMITTED as
if no error occured. In a server node transaction state gets marked as
UNKNOWN though.

- setters in SpiQuery return SqlQuery type (rather than SpiQuery) which
means they can't be used in method chaining manner

Kamil



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/SpiQuery-fails-with-exception-tp3615p3626.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: SpiQuery fails with exception

Posted by vkulichenko <va...@gmail.com>.
Kamil,

I reproduced the issue and created a ticket:
https://issues.apache.org/jira/browse/IGNITE-2881. Someone in the community
will pick it up and fix.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/SpiQuery-fails-with-exception-tp3615p3625.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: SpiQuery fails with exception

Posted by knowak <ka...@gmail.com>.
Hi Val,

Exception is thrown every time we run a query or, more specifically, when we
start to iterate on result QueryCursor.

Please find server and client node code snippet with configuration and SPI
query. 

// server node
Ignite igniteServerNode = Ignitions.start(new IgniteConfiguration()
   (...)
   .setIndexingSpi(new CustomIndexSpi()) // returns iterator
(ArrayList.iterator()) on query
   .setCacheConfiguration(
           new CacheConfiguration(Person.class.getSimpleName())
                    (...)
                   .setCacheMode(CacheMode.PARTITIONED)
                   .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL));

// start server node as separate process


// client node
Ignite igniteClientNode = Ignitions.start(new IgniteConfiguration()
   (...)
   .setClientMode(true);

IgniteCache<Long, Person> personCache =
igniteClientNode.getOrCreateCache(Person.class.getSimpleName());
QueryCursor<Cache.Entry&lt;Long, Person>> cursor = personCache.query(new
SpiQuery<Long, Person>().setArgs("argument1"));

cursor.forEach(person -> { // throws exception
    LOG.info("... found person {}");
});


Additionally,  adding client side stacktrace (one from previous post was
raised in server process).

Exception in thread "main" javax.cache.CacheException: class
org.apache.ignite.IgniteCheckedException: Query execution failed:
GridCacheQueryBean [qry=GridCacheQueryAdapter [type=SPI, clsName=null,
clause=null, filter=null, part=null, incMeta=false,
metrics=GridCacheQueryMetricsAdapter [minTime=0, maxTime=0, sumTime=0,
avgTime=0.0, execs=0, completed=0, fails=0], pageSize=1024, timeout=0,
keepAll=true, incBackups=false, dedup=false, prj=null, keepBinary=false,
subjId=80183557-7672-43e4-90e9-71df4af08b4f, taskHash=0], rdc=null,
trans=null]
               at
org.apache.ignite.internal.processors.cache.GridCacheUtils.convertToCacheException(GridCacheUtils.java:1618)
               at
org.apache.ignite.internal.processors.cache.query.GridCacheQueryFutureAdapter.next(GridCacheQueryFutureAdapter.java:181)
               at
org.apache.ignite.internal.processors.cache.IgniteCacheProxy$5.onHasNext(IgniteCacheProxy.java:528)
               at
org.apache.ignite.internal.util.GridCloseableIteratorAdapter.hasNextX(GridCloseableIteratorAdapter.java:53)
               at
org.apache.ignite.internal.util.lang.GridIteratorAdapter.hasNext(GridIteratorAdapter.java:45)
               at java.lang.Iterable.forEach(Iterable.java:74)
               (…)


Thanks,
Kamil



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/SpiQuery-fails-with-exception-tp3615p3619.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: SpiQuery fails with exception

Posted by vkulichenko <va...@gmail.com>.
Hi Kamil,

Is it reproduced each time you run the query or only under the load? Is it
possible for you to share the code with us, so that we can investigate?

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/SpiQuery-fails-with-exception-tp3615p3617.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.