NPE from the native persistence enable node

2018-01-17 Thread aa...@tophold.com
Hi All, 

As a simple native persistence node, if kill and reboot sometime NPE may thrown.

From the code the really root cause should be the BPlusTree#doPut  #putDown's 
Result is not Expected, 

But even in the CacheObjectBinaryProcessorImpl#metadata  the holder != null  
should be checked earlier


Regards
Aaron
org.apache.ignite.IgniteCheckedException: null
at org.apache.ignite.internal.util.IgniteUtils.cast(IgniteUtils.java:7252) 
~[ignite-core-2.3.0.jar!/:2.3.0]
at 
org.apache.ignite.internal.util.future.GridFutureAdapter.resolve(GridFutureAdapter.java:259)
 ~[ignite-core-2.3.0.jar!/:2.3.0]
at 
org.apache.ignite.internal.util.future.GridFutureAdapter.get0(GridFutureAdapter.java:207)
 ~[ignite-core-2.3.0.jar!/:2.3.0]
at 
org.apache.ignite.internal.util.future.GridFutureAdapter.get(GridFutureAdapter.java:159)
 ~[ignite-core-2.3.0.jar!/:2.3.0]
at 
org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body(GridCachePartitionExchangeManager.java:2289)
 ~[ignite-core-2.3.0.jar!/:2.3.0]
at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110) 
~[ignite-core-2.3.0.jar!/:2.3.0]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
Caused by: java.lang.NullPointerException
at 
org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl.metadata(CacheObjectBinaryProcessorImpl.java:538)
 ~[ignite-core-2.3.0.jar!/:2.3.0]
at 
org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$2.metadata(CacheObjectBinaryProcessorImpl.java:194)
 ~[ignite-core-2.3.0.jar!/:2.3.0]
at 
org.apache.ignite.internal.binary.BinaryContext.metadata(BinaryContext.java:1266)
 ~[ignite-core-2.3.0.jar!/:2.3.0]
at 
org.apache.ignite.internal.binary.BinaryReaderExImpl.getOrCreateSchema(BinaryReaderExImpl.java:2005)
 ~[ignite-core-2.3.0.jar!/:2.3.0]
at 
org.apache.ignite.internal.binary.BinaryReaderExImpl.(BinaryReaderExImpl.java:284)
 ~[ignite-core-2.3.0.jar!/:2.3.0]
at 
org.apache.ignite.internal.binary.BinaryReaderExImpl.(BinaryReaderExImpl.java:183)
 ~[ignite-core-2.3.0.jar!/:2.3.0]
at 
org.apache.ignite.internal.binary.BinaryObjectImpl.reader(BinaryObjectImpl.java:830)
 ~[ignite-core-2.3.0.jar!/:2.3.0]
at 
org.apache.ignite.internal.binary.BinaryObjectImpl.reader(BinaryObjectImpl.java:845)
 ~[ignite-core-2.3.0.jar!/:2.3.0]
at 
org.apache.ignite.internal.binary.BinaryObjectImpl.field(BinaryObjectImpl.java:308)
 ~[ignite-core-2.3.0.jar!/:2.3.0]
at 
org.apache.ignite.internal.processors.query.property.QueryBinaryProperty.fieldValue(QueryBinaryProperty.java:245)
 ~[ignite-core-2.3.0.jar!/:2.3.0]
at 
org.apache.ignite.internal.processors.query.property.QueryBinaryProperty.value(QueryBinaryProperty.java:139)
 ~[ignite-core-2.3.0.jar!/:2.3.0]
at 
org.apache.ignite.internal.processors.query.h2.H2RowDescriptor.columnValue(H2RowDescriptor.java:303)
 ~[ignite-indexing-2.3.0.jar!/:2.3.0]
at 
org.apache.ignite.internal.processors.query.h2.opt.GridH2KeyValueRowOnheap.getValue(GridH2KeyValueRowOnheap.java:160)
 ~[ignite-indexing-2.3.0.jar!/:2.3.0]
at 
org.apache.ignite.internal.processors.query.h2.opt.GridH2KeyValueRowOnheap.toString(GridH2KeyValueRowOnheap.java:209)
 ~[ignite-indexing-2.3.0.jar!/:2.3.0]
at java.lang.String.valueOf(String.java:2994) ~[?:1.8.0_131]
at java.lang.StringBuilder.append(StringBuilder.java:131) ~[?:1.8.0_131]
at 
org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree.doPut(BPlusTree.java:2039)
 ~[ignite-core-2.3.0.jar!/:2.3.0]
at 
org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree.put(BPlusTree.java:1977)
 ~[ignite-core-2.3.0.jar!/:2.3.0]
at 
org.apache.ignite.internal.processors.query.h2.database.H2TreeIndex.put(H2TreeIndex.java:197)
 ~[ignite-indexing-2.3.0.jar!/:2.3.0]
at 
org.apache.ignite.internal.processors.query.h2.opt.GridH2Table.doUpdate(GridH2Table.java:472)
 ~[ignite-indexing-2.3.0.jar!/:2.3.0]
at 
org.apache.ignite.internal.processors.query.h2.opt.GridH2Table.update(GridH2Table.java:423)
 ~[ignite-indexing-2.3.0.jar!/:2.3.0]
at 
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.store(IgniteH2Indexing.java:559)
 ~[ignite-indexing-2.3.0.jar!/:2.3.0]
at 
org.apache.ignite.internal.processors.query.GridQueryProcessor.store(GridQueryProcessor.java:1747)
 ~[ignite-core-2.3.0.jar!/:2.3.0]
at 
org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager.store(GridCacheQueryManager.java:425)
 ~[ignite-core-2.3.0.jar!/:2.3.0]
at 
org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl$CacheDataStoreImpl.finishUpdate(IgniteCacheOffheapManagerImpl.java:1344)
 ~[ignite-core-2.3.0.jar!/:2.3.0]
at 
org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl$CacheDataStoreImpl.update(IgniteCacheOffheapManagerImpl.java:1316)
 ~[ignite-core-2.3.0.jar!/:2.3.0]
at 
org.apache.ignite.internal.processors.cache.persistence.GridCacheOffheapManager$GridCacheDataStore.update(GridCacheOffheapManager.java:1235)
 ~[ignite-core-2.3.0.jar!/:2.3.0]

Re: NPE from the native persistence enable node

2018-01-17 Thread Mikhail
Hi Aaron,

Can you always reproduce the issue? 
Might be you have a reproducer for this issue?

I created a ticket:
https://issues.apache.org/jira/browse/IGNITE-7458

but I don't think that it will be fixed without a reproducer, so it will be
great if you'll provide one,  I'll attach it to the ticket.

Thanks,
Mike.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/


Re: NPE from the native persistence enable node

2018-01-19 Thread Sergey Chugunov
Mikhail,

I believe this NPE is already fixed as part of [1] and will be released in
2.4 version soon.

I'm going to close IGNITE-7458 as duplicate with corresponding JIRA link.

[1] https://issues.apache.org/jira/browse/IGNITE-6668

On Thu, Jan 18, 2018 at 3:03 AM, Mikhail 
wrote:

> Hi Aaron,
>
> Can you always reproduce the issue?
> Might be you have a reproducer for this issue?
>
> I created a ticket:
> https://issues.apache.org/jira/browse/IGNITE-7458
>
> but I don't think that it will be fixed without a reproducer, so it will be
> great if you'll provide one,  I'll attach it to the ticket.
>
> Thanks,
> Mike.
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>


Re: NPE from the native persistence enable node

2018-05-28 Thread renatomelo
I have a similar issue.

If I run local, two nodes connected via TcpDiscoveryMulticastIpFinder it
works fine. But when I run o Kubernetes where the same two nodes are
connected by TcpDiscoveryKubernetesIpFinder Ignite throws those errors.

I have a test SQL table created: 

CREATE TABLE TEST (KEY INT PRIMARY KEY, VALUE VARCHAR(50)) WITH
"TEMPLATE=REPLICATED, BACKUPS=1";

INSERT INTO TEST (KEY, VALUE) VALUES (1, 'HUM');
INSERT INTO TEST (KEY, VALUE) VALUES (2, 'DOIS');
INSERT INTO TEST (KEY, VALUE) VALUES (3, 'TRES');

This is the table before the cluster restart:
visor> cache -scan -c=@c1
Entries in cache: SQL_PUBLIC_TEST
++
| Key Class | Key |   Value Class   |   
   
Value|
++
| java.lang.Integer | 1   | o.a.i.i.binary.BinaryObjectImpl |
SQL_PUBLIC_TEST_2deedad3_5688_4dcc_931e_f3a92bce6d2b [hash=-639447685,
VALUE=HUM]  |
| java.lang.Integer | 2   | o.a.i.i.binary.BinaryObjectImpl |
SQL_PUBLIC_TEST_2deedad3_5688_4dcc_931e_f3a92bce6d2b [hash=-900323687,
VALUE=DOIS] |
| java.lang.Integer | 3   | o.a.i.i.binary.BinaryObjectImpl |
SQL_PUBLIC_TEST_2deedad3_5688_4dcc_931e_f3a92bce6d2b [hash=-899844272,
VALUE=TRES] |
++

And this is the cache after restart.
visor> cache -scan -c=@c1
Entries in cache: SQL_PUBLIC_TEST
++
| Key Class | Key |   Value Class   |   
 
Value  |
++
| java.lang.Integer | 1   | o.a.i.i.binary.BinaryObjectImpl |
BinaryObjectImpl [hash=-639447685, typeId=-2030003012] |
| java.lang.Integer | 3   | o.a.i.i.binary.BinaryObjectImpl |
BinaryObjectImpl [hash=-899844272, typeId=-2030003012] |
| java.lang.Integer | 2   | o.a.i.i.binary.BinaryObjectImpl |
BinaryObjectImpl [hash=-900323687, typeId=-2030003012] |
++

As you can see the SQL_PUBLIC_TEST class was replaced by BinaryObjectImpl or
the original binary class was not found, as I can see a NPE on the logs:

[14:46:34,148][SEVERE][query-#355][GridMapQueryExecutor] Failed to execute
local query.
class org.apache.ignite.IgniteCheckedException: Failed to execute SQL query.
at
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.executeSqlQuery(IgniteH2Indexing.java:968)
at
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.executeSqlQueryWithTimer(IgniteH2Indexing.java:1027)
at
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.executeSqlQueryWithTimer(IgniteH2Indexing.java:1006)
at
org.apache.ignite.internal.processors.query.h2.twostep.GridMapQueryExecutor.onQueryRequest0(GridMapQueryExecutor.java:670)
at
org.apache.ignite.internal.processors.query.h2.twostep.GridMapQueryExecutor.onQueryRequest(GridMapQueryExecutor.java:516)
at
org.apache.ignite.internal.processors.query.h2.twostep.GridMapQueryExecutor.onMessage(GridMapQueryExecutor.java:214)
at
org.apache.ignite.internal.processors.query.h2.twostep.GridMapQueryExecutor$2.onMessage(GridMapQueryExecutor.java:174)
at
org.apache.ignite.internal.managers.communication.GridIoManager$ArrayListener.onMessage(GridIoManager.java:2332)
at
org.apache.ignite.internal.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1555)
at
org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:1183)
at
org.apache.ignite.internal.managers.communication.GridIoManager.access$4200(GridIoManager.java:126)
at
org.apache.ignite.internal.managers.communication.GridIoManager$9.run(GridIoManager.java:1090)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.h2.jdbc.JdbcSQLException: General error:
"java.lang.NullPointerException"; SQL statement:
SELECT
__Z0.KEY __C0_0,
__Z0.VALUE __C0_1
FROM PUBLIC.TEST __Z0 [5-195]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:168)
at org.h2.message.DbException.convert(DbExceptio

Re: NPE from the native persistence enable node

2018-05-29 Thread ilya.kasnacheev
Hello!

I think this errors stems from the fact that you preserve persistence dir
between runs, but not Ignit work dir, and specifically not work/marshaller.
It is crucial to preserve contents of this directory between node restarts.

It is recommended to set workDirectory to some persistent location in
configuration. By default, persistent regions will be located below that
dir.

Regards,



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/


Re: NPE from the native persistence enable node

2018-05-29 Thread renatomelo
Thank you Ilya. 

Instead of configuring individual store dir on kubernetes pvc, I pointed the
workDirectory to the pvd and there is no more NPE, but after restarting the
whole cluster a new SQL class has been generated to represent the SQL cache.

visor> cache -scan -c=@c0
Entries in cache: SQL_PUBLIC_TEST
+===+
| Key Class | Key |   Value Class   |   
 
Value |
+===+
| java.lang.Integer | 1   | o.a.i.i.binary.BinaryObjectImpl |
SQL_PUBLIC_TEST_c2efff0d_88fd_4e7c_8129_8edd0266b9cd [hash=-639447685,
VALUE=HUM] |
| java.lang.Integer | 2   | o.a.i.i.binary.BinaryObjectImpl |
SQL_PUBLIC_TEST_c2efff0d_88fd_4e7c_8129_8edd0266b9cd [hash=-900323687,
VALUE=DOIS]|
| java.lang.Integer | 3   | o.a.i.i.binary.BinaryObjectImpl |
SQL_PUBLIC_TEST_c2efff0d_88fd_4e7c_8129_8edd0266b9cd [hash=-899844272,
VALUE=TRES]|
*| java.lang.Integer | 4   | o.a.i.i.binary.BinaryObjectImpl |
SQL_PUBLIC_TEST_2c59ca2b_5bf9_425d_879f_cba889a00370 [hash=-1938178378,
VALUE=QUATRO] |
| java.lang.Integer | 5   | o.a.i.i.binary.BinaryObjectImpl |
SQL_PUBLIC_TEST_2c59ca2b_5bf9_425d_879f_cba889a00370 [hash=346184433,
VALUE=CINCO]|*
+---+
 
Is there a way to tell Ignite to use the same SQL class?



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/


Re: NPE from the native persistence enable node

2018-06-04 Thread ilya.kasnacheev
Hello!

Yes, you should be able to do that by specifying WITH "VALUE_TYPE=..."
Look it up on readme.io:
https://apacheignite-sql.readme.io/docs/create-table

Regards,



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/


Re: NPE from the native persistence enable node

2018-06-08 Thread Renato Melo
Thank you Ilya, it worked!
 

Em segunda-feira, 4 de junho de 2018 15:44:35 GMT-3, ilya.kasnacheev 
 escreveu:  
 
 Hello!

Yes, you should be able to do that by specifying WITH "VALUE_TYPE=..."
Look it up on readme.io:
https://apacheignite-sql.readme.io/docs/create-table

Regards,



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/