Eduard Shangareev created IGNITE-10478:
------------------------------------------

             Summary: SQL index creation fails if cache, which query method was 
called, was statically configured
                 Key: IGNITE-10478
                 URL: https://issues.apache.org/jira/browse/IGNITE-10478
             Project: Ignite
          Issue Type: Improvement
          Components: sql
            Reporter: Eduard Shangareev


{code}
javax.cache.CacheException: Cache doesn't exist: cache2
    at 
org.apache.ignite.internal.processors.cache.IgniteCacheProxyImpl.query(IgniteCacheProxyImpl.java:698)
    at 
org.apache.ignite.internal.processors.cache.IgniteCacheProxyImpl.query(IgniteCacheProxyImpl.java:637)
    at 
org.apache.ignite.internal.processors.cache.GatewayProtectedCacheProxy.query(GatewayProtectedCacheProxy.java:455)
    at 
org.gridgain.grid.internal.processors.cache.database.IgniteDbSnapshotSameTopologyTest.testDynamicIndexForStaticCacheRestoredWithRebuild(IgniteDbSnapshotSameTopologyTest.java:1469)
    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 junit.framework.TestCase.runTest(TestCase.java:176)
    at 
org.apache.ignite.testframework.junits.GridAbstractTest.runTestInternal(GridAbstractTest.java:2166)
    at 
org.apache.ignite.testframework.junits.GridAbstractTest.access$000(GridAbstractTest.java:144)
    at 
org.apache.ignite.testframework.junits.GridAbstractTest$5.run(GridAbstractTest.java:2082)
    at java.lang.Thread.run(Thread.java:745)
Caused by: class 
org.apache.ignite.internal.processors.query.IgniteSQLException: Cache doesn't 
exist: cache2
    at 
org.apache.ignite.internal.processors.query.h2.ddl.DdlStatementsProcessor.convert(DdlStatementsProcessor.java:642)
    at 
org.apache.ignite.internal.processors.query.h2.ddl.DdlStatementsProcessor.runDdlStatement(DdlStatementsProcessor.java:242)
    at 
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.queryDistributedSqlFieldsNative(IgniteH2Indexing.java:1661)
    at 
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.querySqlFields(IgniteH2Indexing.java:1823)
    at 
org.apache.ignite.internal.processors.query.GridQueryProcessor$4.applyx(GridQueryProcessor.java:2175)
    at 
org.apache.ignite.internal.processors.query.GridQueryProcessor$4.applyx(GridQueryProcessor.java:2170)
    at 
org.apache.ignite.internal.util.lang.IgniteOutClosureX.apply(IgniteOutClosureX.java:36)
    at 
org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:2678)
    at 
org.apache.ignite.internal.processors.query.GridQueryProcessor.lambda$querySqlFields$0(GridQueryProcessor.java:2184)
    at 
org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuerySafe(GridQueryProcessor.java:2204)
    at 
org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:2165)
    at 
org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:2126)
    at 
org.apache.ignite.internal.processors.cache.IgniteCacheProxyImpl.query(IgniteCacheProxyImpl.java:686)
    ... 12 more
{code}

As I see it is thrown from 
{code}
 if (cache == null || !F.eq(depId, cache.context().dynamicDeploymentId()))
            throw new 
SchemaOperationException(SchemaOperationException.CODE_CACHE_NOT_FOUND, 
cacheName);
{code}
at 
org.apache.ignite.internal.processors.query.GridQueryProcessor#processSchemaOperationLocal.

And the second check fails.

It looks strange from my point of view why we throw CODE_CACHE_NOT_FOUND in 
this case.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to