Problem with writeBehind Apache Ignite 2.8.1

classic Classic list List threaded Threaded
7 messages Options
manueltg89 manueltg89
Reply | Threaded
Open this post in threaded view
|

Problem with writeBehind Apache Ignite 2.8.1

Hello, I use Apache Ignite with MariaDB (RDBMS Integration), all works
properly except "writeBehind", if I activate "writeBehind" and I insert for
example 200 instances with PHP PDO I receive a exception on console of
Ignite, the exception is the following:

jun 17, 2020 4:03:45 PM org.apache.ignite.logger.java.JavaLogger error
GRAVE: Failed to execute SQL query [reqId=0, req=OdbcQueryExecuteRequest
[schema=PUBLIC, sqlQry=INSERT INTO scrapy_brand(id, name, keyname) VALUES
(brandId(), ?, ?), autoCommit=true, timeout=0, args=Object[] [manuela4939,
manuela4939]]]
class org.apache.ignite.internal.processors.query.IgniteSQLException: Failed
to execute DML statement [stmt=INSERT INTO scrapy_brand(id, name, keyname)
VALUES (brandId(), ?, ?), params=[manuela4939, manuela4939]]
        at
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.executeDml(IgniteH2Indexing.java:1247)
        at
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.querySqlFields(IgniteH2Indexing.java:1144)
        at
org.apache.ignite.internal.processors.query.GridQueryProcessor$3.applyx(GridQueryProcessor.java:2406)
        at
org.apache.ignite.internal.processors.query.GridQueryProcessor$3.applyx(GridQueryProcessor.java:2402)
        at
org.apache.ignite.internal.util.lang.IgniteOutClosureX.apply(IgniteOutClosureX.java:36)
        at
org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:2919)
        at
org.apache.ignite.internal.processors.query.GridQueryProcessor.lambda$querySqlFields$1(GridQueryProcessor.java:2422)
        at
org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuerySafe(GridQueryProcessor.java:2460)
        at
org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:2396)
        at
org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:2323)
        at
org.apache.ignite.internal.processors.odbc.odbc.OdbcRequestHandler.executeQuery(OdbcRequestHandler.java:403)
        at
org.apache.ignite.internal.processors.odbc.odbc.OdbcRequestHandler.doHandle(OdbcRequestHandler.java:233)
        at
org.apache.ignite.internal.processors.odbc.odbc.OdbcRequestHandler.handle(OdbcRequestHandler.java:196)
        at
org.apache.ignite.internal.processors.odbc.ClientListenerNioListener.onMessage(ClientListenerNioListener.java:195)
        at
org.apache.ignite.internal.processors.odbc.ClientListenerNioListener.onMessage(ClientListenerNioListener.java:49)
        at
org.apache.ignite.internal.util.nio.GridNioFilterChain$TailFilter.onMessageReceived(GridNioFilterChain.java:279)
        at
org.apache.ignite.internal.util.nio.GridNioFilterAdapter.proceedMessageReceived(GridNioFilterAdapter.java:109)
        at
org.apache.ignite.internal.util.nio.GridNioAsyncNotifyFilter$3.body(GridNioAsyncNotifyFilter.java:97)
        at
org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:120)
        at
org.apache.ignite.internal.util.worker.GridWorkerPool$1.run(GridWorkerPool.java:70)
        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: class
org.apache.ignite.internal.transactions.IgniteTxRollbackCheckedException:
Transaction has been rolled back:
a186692c271-00000000-0c27-0020-0000-000000000001
        at
org.apache.ignite.internal.processors.cache.GridCacheAdapter.syncOp(GridCacheAdapter.java:4365)
        at
org.apache.ignite.internal.processors.cache.GridCacheAdapter.put0(GridCacheAdapter.java:2599)
        at
org.apache.ignite.internal.processors.cache.GridCacheAdapter.put(GridCacheAdapter.java:2580)
        at
org.apache.ignite.internal.processors.cache.GridCacheAdapter.putIfAbsent(GridCacheAdapter.java:3007)
        at
org.apache.ignite.internal.processors.query.h2.dml.DmlUtils.dmlDoInsert(DmlUtils.java:197)
        at
org.apache.ignite.internal.processors.query.h2.dml.DmlUtils.processSelectResult(DmlUtils.java:168)
        at
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.executeUpdateNonTransactional(IgniteH2Indexing.java:2920)
        at
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.executeUpdate(IgniteH2Indexing.java:2774)
        at
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.executeUpdateDistributed(IgniteH2Indexing.java:2704)
        at
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.executeDml(IgniteH2Indexing.java:1218)
        ... 22 more
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to load
object [table=scrapybd.scrapy_brand, key=12689]
        at
org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadFromStore(GridCacheStoreManagerAdapter.java:335)
        at
org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.load(GridCacheStoreManagerAdapter.java:293)
        at
org.apache.ignite.internal.processors.cache.GridCacheMapEntry.readThrough(GridCacheMapEntry.java:624)
        at
org.apache.ignite.internal.processors.cache.GridCacheMapEntry.innerGet0(GridCacheMapEntry.java:883)
        at
org.apache.ignite.internal.processors.cache.GridCacheMapEntry.innerGet(GridCacheMapEntry.java:640)
        at
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxPrepareFuture.onEntriesLocked(GridDhtTxPrepareFuture.java:404)
        at
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxPrepareFuture.prepare0(GridDhtTxPrepareFuture.java:1304)
        at
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxPrepareFuture.mapIfLocked(GridDhtTxPrepareFuture.java:709)
        at
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxPrepareFuture.prepare(GridDhtTxPrepareFuture.java:1102)
        at
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTxLocal.prepareAsync(GridDhtTxLocal.java:411)
        at
org.apache.ignite.internal.processors.cache.transactions.IgniteTxHandler.prepareNearTx(IgniteTxHandler.java:577)
        at
org.apache.ignite.internal.processors.cache.transactions.IgniteTxHandler.prepareNearTx(IgniteTxHandler.java:374)
        at
org.apache.ignite.internal.processors.cache.transactions.IgniteTxHandler.processNearTxPrepareRequest0(IgniteTxHandler.java:183)
        at
org.apache.ignite.internal.processors.cache.transactions.IgniteTxHandler.processNearTxPrepareRequest(IgniteTxHandler.java:161)
        at
org.apache.ignite.internal.processors.cache.transactions.IgniteTxHandler.access$000(IgniteTxHandler.java:123)
        at
org.apache.ignite.internal.processors.cache.transactions.IgniteTxHandler$1.apply(IgniteTxHandler.java:205)
        at
org.apache.ignite.internal.processors.cache.transactions.IgniteTxHandler$1.apply(IgniteTxHandler.java:203)
        at
org.apache.ignite.internal.processors.cache.GridCacheIoManager.processMessage(GridCacheIoManager.java:1142)
        at
org.apache.ignite.internal.processors.cache.GridCacheIoManager.onMessage0(GridCacheIoManager.java:591)
        at
org.apache.ignite.internal.processors.cache.GridCacheIoManager.handleMessage(GridCacheIoManager.java:392)
        at
org.apache.ignite.internal.processors.cache.GridCacheIoManager.handleMessage(GridCacheIoManager.java:318)
        at
org.apache.ignite.internal.processors.cache.GridCacheIoManager.access$100(GridCacheIoManager.java:109)
        at
org.apache.ignite.internal.processors.cache.GridCacheIoManager$1.onMessage(GridCacheIoManager.java:308)
        at
org.apache.ignite.internal.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1847)
        at
org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:1472)
        at
org.apache.ignite.internal.managers.communication.GridIoManager.access$5200(GridIoManager.java:229)
        at
org.apache.ignite.internal.managers.communication.GridIoManager$9.run(GridIoManager.java:1367)
        at
org.apache.ignite.internal.util.StripedExecutor$Stripe.body(StripedExecutor.java:565)
        at
org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:120)
        ... 1 more
Caused by: javax.cache.integration.CacheLoaderException: Failed to load
object [table=scrapybd.scrapy_brand, key=12689]
        at
org.apache.ignite.cache.store.jdbc.CacheAbstractJdbcStore.load(CacheAbstractJdbcStore.java:852)
        at
org.apache.ignite.internal.processors.cache.store.GridCacheWriteBehindStore.load(GridCacheWriteBehindStore.java:531)
        at
org.apache.ignite.internal.processors.cache.CacheStoreBalancingWrapper.load(CacheStoreBalancingWrapper.java:98)
        at
org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadFromStore(GridCacheStoreManagerAdapter.java:327)
        ... 29 more
Caused by: java.sql.SQLNonTransientConnectionException: Data source rejected
establishment of connection,  message from server: "Too many connections"
        at
com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110)
        at
com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
        at
com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
        at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:836)
        at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456)
        at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)
        at
com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:197)
        at
com.mysql.cj.jdbc.MysqlDataSource.getConnection(MysqlDataSource.java:416)
        at
com.mysql.cj.jdbc.MysqlDataSource.getConnection(MysqlDataSource.java:128)
        at
com.mysql.cj.jdbc.MysqlDataSource.getConnection(MysqlDataSource.java:113)
        at
org.apache.ignite.cache.store.jdbc.CacheAbstractJdbcStore.openConnection(CacheAbstractJdbcStore.java:325)
        at
org.apache.ignite.cache.store.jdbc.CacheAbstractJdbcStore.connection(CacheAbstractJdbcStore.java:345)
        at
org.apache.ignite.cache.store.jdbc.CacheAbstractJdbcStore.load(CacheAbstractJdbcStore.java:840)
        ... 32 more

It seems that Apache Ignite wants to open many connections to my MariaDB
server, how can I limit this?

Thanks in advance.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
akorensh akorensh
Reply | Threaded
Open this post in threaded view
|

Re: Problem with writeBehind Apache Ignite 2.8.1

Hi,
  This shouldn't be happening. Please attach  a reproducer and I'll take a
look.
   Describe the steps you take to reproduce scenario. Include version #'s
for all affected components.
Thanks, Alex




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
manueltg89 manueltg89
Reply | Threaded
Open this post in threaded view
|

Re: Problem with writeBehind Apache Ignite 2.8.1

This post was updated on .
In reply to this post by manueltg89
Hi. I attach example project. I explain a bit more. Details:

- Apache Ignite version: 2.8.1
- MySQL Server with max connections form example: 151
- Insert with PHP PDO from PHP 7.2:



It seems that Apache Ignite with writeBehind enabled open one connection by
insert and keeps open every connection over time, this  bug-project.rar
<http://apache-ignite-users.70518.x6.nabble.com/file/t2878/bug-project.rar
that MySQL Server throws "Too many connections" error.

In attached file you have "bugdb.sql" file with database schema for MySQL.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ilya.kasnacheev ilya.kasnacheev
Reply | Threaded
Open this post in threaded view
|

Re: Problem with writeBehind Apache Ignite 2.8.1

Hello!

What do I need to run to observe the problem? I run ServerNodeCodeStartup but it runs OK.

If there should be any images in your message, they're not there.

Regards,
--
Ilya Kasnacheev


пт, 19 июн. 2020 г. в 11:12, manueltg89 <[hidden email]>:
Hi. I attach example project. I explain a bit more. Details:

- MySQL Server with max connections form example: 151
- Insert with PHP PDO from PHP 7.2:



It seems that Apache Ignite with writeBehind enabled open one connection by
insert and keeps open every connection over time, this  bug-project.rar
<http://apache-ignite-users.70518.x6.nabble.com/file/t2878/bug-project.rar
that MySQL Server throws "Too many connections" error.

In attached file you have "bugdb.sql" file with database schema for MySQL.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
manueltg89 manueltg89
Reply | Threaded
Open this post in threaded view
|

Re: Problem with writeBehind Apache Ignite 2.8.1

You need to have MySQL Server with schema "bugdb.sql" imported, config your
mysql database in "secret.properties", run "ServerNodeCodeStartup" and
execute PHP file with inserts to Apache Ignite.

Sorry, there was a problem to attach PHP file. I've attached also PHP file
now.

bug.php <http://apache-ignite-users.70518.x6.nabble.com/file/t2878/bug.php>  
 





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ilya.kasnacheev ilya.kasnacheev
Reply | Threaded
Open this post in threaded view
|

Re: Problem with writeBehind Apache Ignite 2.8.1

Hello!

I think there is indeed a problem with Cache Store here: https://issues.apache.org/jira/browse/IGNITE-13167

I hope it will get fixed, until it isn't I recommend switching that cache to ATOMIC mode, this will help sidestep the issue.

Regards,
--
Ilya Kasnacheev


пт, 19 июн. 2020 г. в 16:22, manueltg89 <[hidden email]>:
You need to have MySQL Server with schema "bugdb.sql" imported, config your
mysql database in "secret.properties", run "ServerNodeCodeStartup" and
execute PHP file with inserts to Apache Ignite.

Sorry, there was a problem to attach PHP file. I've attached also PHP file
now.

bug.php <http://apache-ignite-users.70518.x6.nabble.com/file/t2878/bug.php






--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
manueltg89 manueltg89
Reply | Threaded
Open this post in threaded view
|

Re: Problem with writeBehind Apache Ignite 2.8.1

Ok, I will be aware to the new changes.

Thank you very much!



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