Hi Ivan, Maksim,
Here is the reproducer:
import org.apache.ignite.Ignition;
import org.apache.ignite.binary.BinaryObject;
import org.apache.ignite.binary.BinaryObjectBuilder;
import org.apache.ignite.cache.QueryEntity;
import org.apache.ignite.client.ClientCache;
import org.apache.ignite.client.IgniteClient;
import org.apache.ignite.configuration.BinaryConfiguration;
import org.apache.ignite.configuration.ClientConfiguration;
import org.junit.jupiter.api.Test;
import java.sql.Timestamp;
import java.time.Instant;
import java.util.*;
import java.util.stream.IntStream;
import static java.util.stream.Collectors.toList;
public class Reproducer {
@Test
public void reproduce() throws InterruptedException {
ClientConfiguration config = constructIgniteThinClientConfig();
IgniteClient ignite = Ignition.startClient(config);
List<UUID> uuids = IntStream.range(0, 200).mapToObj((i) ->
UUID.randomUUID()).collect(toList());
while (true) {
upsertLimitViewData(ignite, uuids);
Thread.sleep(1000);
}
}
private void upsertLimitViewData(IgniteClient ignite, List<UUID> uuids) {
System.out.println("[" + Instant.now() + "] upserting data... " +
Thread.currentThread().getName());
ClientCache<Object, Object> cache =
ignite.cache("LimitViewStatusCache").withKeepBinary();
QueryEntity queryEntity =
cache.getConfiguration().getQueryEntities()[0];
BinaryObjectBuilder keyBuilder =
ignite.binary().builder(queryEntity.getKeyType());
BinaryObjectBuilder valueBuilder =
ignite.binary().builder(queryEntity.getValueType());
HashMap<Object, Object> valueMap = new HashMap<>();
for (int i = 0; i < 200; i++) {
BinaryObject key = keyBuilder
.setField("viewId", uuids.get(i))
.setField("status", "moo")
.build();
BinaryObject value = valueBuilder
.setField("batchId", new Random().nextInt())
.setField("instance", Integer.toString(new
Random().nextInt()))
.setField("nodes", Integer.toString(new Random().nextInt()))
.setField("eqtgContext", Integer.toString(new
Random().nextInt()))
.setField("lastUpdateTime", Timestamp.from(Instant.now()))
.build();
valueMap.put(key, value);
}
cache.putAll(valueMap);
}
private ClientConfiguration constructIgniteThinClientConfig() {
return
new ClientConfiguration()
.setAddresses("xxx:10800")
.setPartitionAwarenessEnabled(false)
.setBinaryConfiguration(new
BinaryConfiguration().setCompactFooter(false))
.setUserName("xxx")
.setUserPassword("xxx");
}
}
Regards,
Marcus
-----Original Message-----
From: [External] Maksim Timonin <[email protected]>
Sent: Thursday, June 10, 2021 12:31 AM
To: [email protected]
Subject: Re: Ignite crashed with CorruptedTreeException
Hi Marcus!
Could you please provide a complete code that inserts data (either it is SQL,
or cache put, which types do you use, etc.). I've tried to reproduce your case
but failed.
Thanks a lot!
--
Sent from:
https://urldefense.com/v3/__http://apache-ignite-users.70518.x6.nabble.com/__;!!Jkho33Y!2v--HF_tnHWeR_0YefFDx-NcnoY3hkO-9G94IAXG23N6qzB_qz-rSYtuciav3A$