[infinispan-issues] [JBoss JIRA] (ISPN-6428) A [mostly harmless] race condition between RemoveExpiredCommand and cache loaders

Krzysztof Sobolewski (JIRA) issues at jboss.org
Wed Mar 23 08:08:00 EDT 2016


Krzysztof Sobolewski created ISPN-6428:
------------------------------------------

             Summary: A [mostly harmless] race condition between RemoveExpiredCommand and cache loaders
                 Key: ISPN-6428
                 URL: https://issues.jboss.org/browse/ISPN-6428
             Project: Infinispan
          Issue Type: Quality Risk
          Components: Core
    Affects Versions: 8.2.0.Final
            Reporter: Krzysztof Sobolewski


There is a cluster (DIST_SYNC in this particular case) with mortal entries (expiration time, no idle time). I try to update an entry and this is what happens:

1) The local node fetches the entry from its owner(s)
2) Each owner sees that the entry is expired
2a) it loads the entry from cache loader
2b) it schedules an asynchronous RemoveExpiredCommand to be sent across the cluster

The RemoveExpiredCommand is meant to opportunistically remove expired entries (in addition to periodically scrubbing the cluster for expired entries), as I understand it.

Now two things happen in parallel:

3a) The entry is returned to the initiating node where it is modified and inserted back, the transaction commits and the changes are replicated
3b) The RemoveExpiredCommand gets replicated

If the 3b completes before 3a, then the entry is removed from all the owners, where it just had been loaded, before it's forced to load again by changes made by 3a.

Now, this is not fatal, it's just inefficient :) But as it happens my code generates an event when the primary owner loads a node and this causes my code to send spurious events in some cases.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the infinispan-issues mailing list