You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by guetsxjm <ke...@coinflex.com> on 2021/05/18 11:55:09 UTC
ignite read stale data from backup node
Hi Ignites,
I ran into in-consistency data issues on version 2.8.1. I have three nodes
run as a cluster and the cache configuration as:
CacheConfiguration<String, Balance> cacheConfiguration = new
CacheConfiguration<>(Balance.class.getSimpleName());
cacheConfiguration.setIndexedTypes(String.class, Balance.class);
cacheConfiguration.setSqlIndexMaxInlineSize(100);
cacheConfiguration.setSqlSchema("PUBLIC");
cacheConfiguration.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
cacheConfiguration.setCacheMode(CacheMode.PARTITIONED);
cacheConfiguration.setBackups(4);
cacheConfiguration.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
Then I have very simple code to add balance in a loop:
for (int i = 0; i < 10000; i++) {
balance = balanceDao.findByKey(accountId, "USD");
balance.setQuantity(balance.getQuantity().add(BigDecimal.ONE));
balanceDao.save(balance);
}
when I run above on the primary node, I always have balance increased 10000
correctly, however when I run that on backup node, sometimes my balance
increased around 8k, and sometimes 9k.
if setWriteSynchronizationMode was set to PRIMARY_SYNC and setReadFromBackup
was set to false, I can get correct balance on all nodes.
is this a bug on 2.8.1 or anything wrong with my configuration?
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: ignite read stale data from backup node
Posted by guetsxjm <ke...@coinflex.com>.
I was trying these two days but failed to reproduce the issue any more.
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: ignite read stale data from backup node
Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!
Can you please share a runnable reproducer project? You may use github.
Regards,
--
Ilya Kasnacheev
вт, 18 мая 2021 г. в 14:55, guetsxjm <ke...@coinflex.com>:
> Hi Ignites,
>
> I ran into in-consistency data issues on version 2.8.1. I have three nodes
> run as a cluster and the cache configuration as:
>
> CacheConfiguration<String, Balance> cacheConfiguration =
> new
> CacheConfiguration<>(Balance.class.getSimpleName());
> cacheConfiguration.setIndexedTypes(String.class, Balance.class);
> cacheConfiguration.setSqlIndexMaxInlineSize(100);
> cacheConfiguration.setSqlSchema("PUBLIC");
>
> cacheConfiguration.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
> cacheConfiguration.setCacheMode(CacheMode.PARTITIONED);
> cacheConfiguration.setBackups(4);
>
>
> cacheConfiguration.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
>
>
> Then I have very simple code to add balance in a loop:
>
> for (int i = 0; i < 10000; i++) {
> balance = balanceDao.findByKey(accountId, "USD");
> balance.setQuantity(balance.getQuantity().add(BigDecimal.ONE));
> balanceDao.save(balance);
> }
>
> when I run above on the primary node, I always have balance increased 10000
> correctly, however when I run that on backup node, sometimes my balance
> increased around 8k, and sometimes 9k.
>
> if setWriteSynchronizationMode was set to PRIMARY_SYNC and
> setReadFromBackup
> was set to false, I can get correct balance on all nodes.
>
>
> is this a bug on 2.8.1 or anything wrong with my configuration?
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>