use of org.apache.ignite.internal.processors.cache.CachePartialUpdateCheckedException in project ignite by apache.
the class GridNearAtomicSingleUpdateFuture method onAllReceived.
/**
* @return Non-null topology version if update should be remapped.
*/
private AffinityTopologyVersion onAllReceived() {
assert Thread.holdsLock(this);
assert futureMapped() : this;
AffinityTopologyVersion remapTopVer0 = null;
if (remapTopVer == null) {
if (err != null && X.hasCause(err, CachePartialUpdateCheckedException.class) && X.hasCause(err, ClusterTopologyCheckedException.class) && storeFuture() && --remapCnt > 0) {
ClusterTopologyCheckedException topErr = X.cause(err, ClusterTopologyCheckedException.class);
if (!(topErr instanceof ClusterTopologyServerNotFoundException)) {
CachePartialUpdateCheckedException cause = X.cause(err, CachePartialUpdateCheckedException.class);
assert cause != null && cause.topologyVersion() != null : err;
remapTopVer0 = new AffinityTopologyVersion(cause.topologyVersion().topologyVersion() + 1);
err = null;
}
}
} else
remapTopVer0 = remapTopVer;
if (remapTopVer0 != null) {
cctx.mvcc().removeAtomicFuture(futId);
reqState = null;
topVer = AffinityTopologyVersion.ZERO;
futId = 0;
remapTopVer = null;
}
return remapTopVer0;
}
use of org.apache.ignite.internal.processors.cache.CachePartialUpdateCheckedException in project ignite by apache.
the class GridNearAtomicSingleUpdateFuture method onNodeLeft.
/**
* {@inheritDoc}
*/
@Override
public boolean onNodeLeft(UUID nodeId) {
GridCacheReturn opRes0 = null;
CachePartialUpdateCheckedException err0 = null;
AffinityTopologyVersion remapTopVer0 = null;
GridNearAtomicCheckUpdateRequest checkReq = null;
boolean rcvAll = false;
long futId;
synchronized (this) {
if (!futureMapped())
return false;
futId = this.futId;
if (reqState.req.nodeId.equals(nodeId)) {
GridNearAtomicAbstractUpdateRequest req = reqState.onPrimaryFail();
if (req != null) {
GridNearAtomicUpdateResponse res = primaryFailedResponse(req);
rcvAll = true;
reqState.onPrimaryResponse(res, cctx);
onPrimaryError(req, res);
}
} else {
DhtLeftResult res = reqState.onDhtNodeLeft(nodeId);
if (res == DhtLeftResult.DONE)
rcvAll = true;
else if (res == DhtLeftResult.ALL_RCVD_CHECK_PRIMARY)
checkReq = new GridNearAtomicCheckUpdateRequest(reqState.req);
else
return false;
}
if (rcvAll) {
opRes0 = opRes;
err0 = err;
remapTopVer0 = onAllReceived();
}
}
if (checkReq != null)
sendCheckUpdateRequest(checkReq);
else if (rcvAll)
finishUpdateFuture(opRes0, err0, remapTopVer0, futId);
return false;
}
Aggregations