ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Semen Boikov (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (IGNITE-2590) IgniteCache.remove() returns false for LOCAL OFFHEAP_TIERED cache inside OPTIMISTIC REPEATABLE_READ transaction.
Date Thu, 18 Feb 2016 08:36:18 GMT

     [ https://issues.apache.org/jira/browse/IGNITE-2590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Semen Boikov updated IGNITE-2590:
---------------------------------
    Fix Version/s: 1.6

> IgniteCache.remove() returns false for LOCAL OFFHEAP_TIERED cache inside OPTIMISTIC REPEATABLE_READ
transaction.
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-2590
>                 URL: https://issues.apache.org/jira/browse/IGNITE-2590
>             Project: Ignite
>          Issue Type: Bug
>    Affects Versions: 1.5.0.final
>            Reporter: Artem Shutak
>            Assignee: Semen Boikov
>             Fix For: 1.6
>
>
> IgniteCache.remove() returns {{false}} for LOCAL OFFHEAP_TIERED cache inside OPTIMISTIC
REPEATABLE_READ transaction. But {{cache.get()}} before and after {{remove}} retuns right
values.
> {code}
>     public static void main(String[] args) {
>         try(Ignite ignite = Ignition.start(new IgniteConfiguration())) {
>             CacheConfiguration cfg = new CacheConfiguration()
>                 .setName("myCache")
>                 .setCacheMode(LOCAL)
>                 .setAtomicityMode(TRANSACTIONAL)
>                 .setMemoryMode(OFFHEAP_TIERED)
>                 ;
>             IgniteCache cache = ignite.getOrCreateCache(cfg);
>             final String key = "key1";
>             TransactionConcurrency concurrency = OPTIMISTIC;
>             TransactionIsolation isolation = REPEATABLE_READ;
>             try (Transaction tx = ignite.transactions().txStart(concurrency, isolation))
{
>                 cache.put(key, 1); 
>                 tx.commit();
>             }
>             try (Transaction tx = ignite.transactions().txStart(concurrency, isolation))
{
>                 Object val = cache.get(key); // Returns 1.
>                 System.out.println("Value: " + val);
>                 tx.commit();
>             }
>             try (Transaction tx = ignite.transactions().txStart(concurrency, isolation))
{
>                 boolean remove = cache.remove(key);
>                 System.out.println("Removed: " + remove);
>                 tx.commit();
>             }
>             try (Transaction tx = ignite.transactions().txStart(concurrency, isolation))
{
>                 Object val = cache.get(key); // Returns null.
>                 System.out.println("Value: " + val);
>                 tx.commit();
>             }
>         }
>     }
> {code}
> It's corner case. For any other MEMORY_MODE it works. 
> For any other concurrency or isolation levels it works.
> It also works if execute {{cache.get()}} before remove inside transaction.
> Test failss for both dynamic and static caches.



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

Mime
View raw message