You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Pavel Tupitsyn (JIRA)" <ji...@apache.org> on 2015/09/11 16:14:47 UTC

[jira] [Created] (IGNITE-1423) Zero expiry policy does not work sometimes

Pavel  Tupitsyn created IGNITE-1423:
---------------------------------------

             Summary: Zero expiry policy does not work sometimes
                 Key: IGNITE-1423
                 URL: https://issues.apache.org/jira/browse/IGNITE-1423
             Project: Ignite
          Issue Type: Bug
          Components: cache
    Affects Versions: 1.1.4
            Reporter: Pavel  Tupitsyn
             Fix For: ignite-1.4


Paste the following test to GridCacheReplicatedMultiNodeFullApiSelfTest.java and run.

{code:title=GridCacheReplicatedMultiNodeFullApiSelfTest.java}
    public void testExpiredBug() throws Exception {
        final ExpiryPolicy plc = new ExpiryPolicy() {
            @Override public Duration getExpiryForCreation() {
                return Duration.ZERO;
            }

            @Override public Duration getExpiryForAccess() {
                return Duration.ZERO;
            }

            @Override public Duration getExpiryForUpdate() {
                return Duration.ZERO;
            }
        };

        IgniteCache c1 = ignite(0).cache(null);
        IgniteCache c2 = ignite(1).cache(null);

        String key0 = primaryKeysForCache(c1, 1).get(0);
        String key1 = primaryKeysForCache(c2, 1).get(0);

        IgniteCache cache0 = c1;
        IgniteCache cache = c1.withExpiryPolicy(plc);

        for (int i = 0; i < 3000; i++) {
            cache.put(key0, key0);
            cache.put(key1, key1);
            assert !cache0.containsKey(key0);
            assert !cache0.containsKey(key1);

            cache0.put(key0, key0);
            cache0.put(key1, key1);
            assert cache0.containsKey(key0);
            assert cache0.containsKey(key1);
            cache.put(key0, key0 + 1);
            cache.put(key1, key1 + 1);
            assert !cache0.containsKey(key0);
            assert !cache0.containsKey(key1);

            cache0.put(key0, key0);
            cache0.put(key1, key1);
            cache.get(key0);
            cache.get(key1);
            assert !cache0.containsKey(key0);
            assert !cache0.containsKey(key1);
        }
    }}
{code}



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