[ 
https://issues.apache.org/jira/browse/IGNITE-1175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14648702#comment-14648702
 ] 

Alexey Goncharuk commented on IGNITE-1175:
------------------------------------------

I believe the fix should be as follows:
 * We do not need deferred delete tracking in transactional cache unless 
replication is enabled. So {{GridCacheContext.deferredDelete()}} should look 
like this:
{code}
    /**
     * @param cache Cache.
     * @return {@code True} if entries should not be deleted from cache 
immediately.
     */
    public boolean deferredDelete(GridCacheAdapter<?, ?> cache) {
        return ((cache.isDht() || cache.isColocated()) && 
cache.context().isDrEnabled()) ||
            cache.isDhtAtomic() || (cache.isNear() && 
cache.configuration().getAtomicityMode() == ATOMIC);
    }
{code}
 * If deferred delete is needed, we need to add entry to deferred delete 
buffer, so need to add {{else}} branch for {{if (!cctx.deferredDelete())}} in 
{{GridCacheMapEntry#innerRemove}}:
{code}
        if (!cctx.deferredDelete()) {
            boolean marked = false;

            synchronized (this) {
                // If entry is still removed.
                if (newVer == ver) {
                    if (obsoleteVer == null || !(marked = 
markObsolete0(obsoleteVer, true))) {
                        if (log.isDebugEnabled())
                            log.debug("Entry could not be marked obsolete (it 
is still used): " + this);
                    }
                    else {
                        recordNodeId(affNodeId, topVer);

                        // If entry was not marked obsolete, then removed lock
                        // will be registered whenever removeLock is called.
                        cctx.mvcc().addRemoved(cctx, obsoleteVer);

                        if (log.isDebugEnabled())
                            log.debug("Entry was marked obsolete: " + this);
                    }
                }
            }

            if (marked)
                onMarkedObsolete();
        }
        else
            cctx.onDeferredDelete(this, newVer);
{code}

> Entries are not removed from GridDhtLocalPartition after IgniteCache.remove
> ---------------------------------------------------------------------------
>
>                 Key: IGNITE-1175
>                 URL: https://issues.apache.org/jira/browse/IGNITE-1175
>             Project: Ignite
>          Issue Type: Bug
>          Components: general
>            Reporter: Irina Vasilinets
>            Assignee: Atri Sharma
>             Fix For: ignite-1.4
>
>
> For transactional cache entries are not removed from 
> GridDhtLocalPartition.map and are not added to remove queue (methods 
> onDeferredDelete and onRemoved are not called from IgniteCache.remove method).
> See CacheDhtLocalPartitionAfterRemoveSelfTest.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to