Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Fixed
-
2.10
Description
Using the 2.10 branch code and the transaction function of cpp thin client, the transaction with id 1 not found error will be throw. the reproduce steps are as follows:
1.start two nodes on two hosts use the following config file:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="clientMode" value="false" />
<property name="peerClassLoadingEnabled" value="true"/>
<property name="binaryConfiguration">
<bean class="org.apache.ignite.configuration.BinaryConfiguration">
<property name="compactFooter" value="false" />
<property name="idMapper">
<bean class="org.apache.ignite.binary.BinaryBasicIdMapper">
<property name="lowerCase" value="true" />
</bean>
</property>
</bean>
</property>
<property name="dataStorageConfiguration">
<bean class="org.apache.ignite.configuration.DataStorageConfiguration">
<property name="defaultDataRegionConfiguration">
<bean class="org.apache.ignite.configuration.DataRegionConfiguration">
<property name="name" value="default" />
<property name="maxSize" value="#{1L * 1024 * 1024 * 1024}" />
<property name="persistenceEnabled" value="false" />
</bean>
</property>
</bean>
</property>
</bean>
</beans>
2.test code are as follows:
Usually only the first few loop operations may throw an exception, and the subsequent operations are normal.
#include <stdint.h>
#include <iostream>
#include <ignite/thin/ignite_client.h>
#include <ignite/thin/cache/cache_client.h>
#include "ignite/examples/organization.h"
using namespace ignite;
using namespace thin;
using namespace cache;
using namespace examples;
int main()
{
IgniteClientConfiguration cfg;
cfg.SetEndPoints("X.X.X.X");
try
{
IgniteClient client = IgniteClient::Start(cfg);
CacheClient<int32_t, Organization> cache = client.GetOrCreateCache<int32_t, Organization>("PutGetExample");
cache.Clear();
int loop = 100;
for (int i = 0; i < loop; i++)
{
ignite::thin::transactions::ClientTransaction transaction = client.ClientTransactions().TxStart();
Organization org("Microsoft", Address("1096 Eddy Street, San Francisco, CA", i));
cache.Put(1, org);
transaction.Commit();
}
Organization orgFromCache = cache.Get(1);
}
catch (IgniteError& err)
{
std::cout << "An error occurred: " << err.GetText() << std::endl;
return err.GetCode();
}
return 0;
3.server side's log are as follows:
[11:25:35,496][SEVERE][client-connector-#117][ClientListenerNioListener] Failed to process client request [req=o.a.i.i.processors.platform.client.tx.ClientTxEndRequest@569bc2e0]
class org.apache.ignite.internal.processors.platform.client.IgniteClientException: Transaction with id 1 not found.
at org.apache.ignite.internal.processors.platform.client.tx.ClientTxEndRequest.process(ClientTxEndRequest.java:59)
at org.apache.ignite.internal.processors.platform.client.ClientRequestHandler.handle(ClientRequestHandler.java:98)
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)
If start two nodes on two hosts and create a cluster, you can reproduce this problem. If start multiple server nodes on one host, it seems that there is no problem.
Thin clients only need one.
See the following discussion for details:
Attachments
Issue Links
- links to