ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vinokurov Pavel <vinokurov.pa...@gmail.com>
Subject Atomic sequence and topology exception
Date Tue, 13 Mar 2018 02:52:29 GMT
Igniters!

I  have a few questions related to a replicated atomic sequence and an
topology exception.
In my case after one server node has left cluster, on a client node the
execution of the *IgniteAtomicSequence#incrementAndGet()* throws exception:

org.apache.ignite.cluster.ClusterTopologyException: Failed to acquire lock
for keys (primary node left grid, retry transaction if possible)
[keys=[UserKeyCacheObjectImpl [part=94, val=GridCacheInternalKeyImpl
[name=seq, grpName=default-ds-group], hasValBytes=true]],
node=a047ec4b-7de6-4503-9691-a5d7e03e267f]

I handle exception in that way:

IgniteAtomicSequence seq = ignite.atomicSequence(Const.SEQ, new
AtomicConfiguration().setAtomicSequenceReserveSize(0)
.setCacheMode(CacheMode.REPLICATED),0, Boolean.TRUE);
while(true){
    //do some logic
try {
*seq.incrementAndGet();*
}
catch (ClusterTopologyException cte) {
*cte.retryReadyFuture().get();*
}
}

At the same time the *IgniteAtomicLong* doesn't throw such exception (at
least I can't reproduce it).

Please help me to clarify flowing questions:
1. Is it recommended to handle topology exception in the same way? Is there
any public documentation about that?
2. What kind of distributed operations(cache updates, open data stream,
atomic) are recommended to handle the ClusterTopologyException?

-- 

Regards

Pavel Vinokurov

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message