You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Aleksey Plekhanov (JIRA)" <ji...@apache.org> on 2018/08/16 18:05:00 UTC

[jira] [Updated] (IGNITE-9303) PageSnapshot can contain wrong pageId tag when not dirty page is recycling

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

Aleksey Plekhanov updated IGNITE-9303:
--------------------------------------
    Description: 
When page is recycling (for example in {{BPlusTree.Remove#freePage()}} -> {{DataStructure#recyclePage()}}) tag of {{pageId}} is modified, but original {{pageId}} is passed to {{writeUnlock()}} method and this passed {{pageId}} is stored to PageSnapshot WAL record.
This bug may lead to errors in WAL applying during crash recovery.

Reproducer (ignite-indexing module must be in classpath):

{code:java}
public class WalFailReproducer extends AbstractWalDeltaConsistencyTest {
    @Override protected boolean checkPagesOnCheckpoint() {
        return true;
    }

    public final void testPutRemoveCacheDestroy() throws Exception {
        CacheConfiguration<Integer, Integer> ccfg = new CacheConfiguration<>("cache0");
        ccfg.setIndexedTypes(Integer.class, Integer.class);

        IgniteEx ignite = startGrid(0);

        ignite.cluster().active(true);

        IgniteCache<Integer, Integer> cache0 = ignite.getOrCreateCache(ccfg);

        for (int i = 0; i < 5_000; i++)
            cache0.put(i, i);

        forceCheckpoint();

        for (int i = 1_000; i < 4_000; i++)
            cache0.remove(i);

        forceCheckpoint();

        stopAllGrids();
    }
}

{code}


  was:
When page is recycling (for example in {{BPlusTree.Remove#freePage()}} -> {{DataStructure#recyclePage()}}) tag of {{pageId}} is modified, but original {{pageId}} is passed to {{writeUnlock()}} method and this passed {{pageId}} is stored to PageSnapshot WAL record.
This bug may lead to errors in WAL applying during crash recovery.

Reproducer (ignite-indexing module must be in classpath):

{code:java}
public class WalFailReproducer extends AbstractWalDeltaConsistencyTest {
    /** {@inheritDoc} */
    @Override protected boolean checkPagesOnCheckpoint() {
        return true;
    }

    /**
     *
     */
    public final void testPutRemoveCacheDestroy() throws Exception {
        CacheConfiguration<Integer, Integer> ccfg = new CacheConfiguration<>("cache0");
        ccfg.setIndexedTypes(Integer.class, Integer.class);

        IgniteEx ignite = startGrid(0);

        ignite.cluster().active(true);

        IgniteCache<Integer, Integer> cache0 = ignite.getOrCreateCache(ccfg);

        for (int i = 0; i < 5_000; i++)
            cache0.put(i, i);

        forceCheckpoint();

        for (int i = 1_000; i < 4_000; i++)
            cache0.remove(i);

        forceCheckpoint();

        stopAllGrids();
    }
}

{code}



> PageSnapshot can contain wrong pageId tag when not dirty page is recycling
> --------------------------------------------------------------------------
>
>                 Key: IGNITE-9303
>                 URL: https://issues.apache.org/jira/browse/IGNITE-9303
>             Project: Ignite
>          Issue Type: Bug
>    Affects Versions: 2.6
>            Reporter: Aleksey Plekhanov
>            Priority: Major
>
> When page is recycling (for example in {{BPlusTree.Remove#freePage()}} -> {{DataStructure#recyclePage()}}) tag of {{pageId}} is modified, but original {{pageId}} is passed to {{writeUnlock()}} method and this passed {{pageId}} is stored to PageSnapshot WAL record.
> This bug may lead to errors in WAL applying during crash recovery.
> Reproducer (ignite-indexing module must be in classpath):
> {code:java}
> public class WalFailReproducer extends AbstractWalDeltaConsistencyTest {
>     @Override protected boolean checkPagesOnCheckpoint() {
>         return true;
>     }
>     public final void testPutRemoveCacheDestroy() throws Exception {
>         CacheConfiguration<Integer, Integer> ccfg = new CacheConfiguration<>("cache0");
>         ccfg.setIndexedTypes(Integer.class, Integer.class);
>         IgniteEx ignite = startGrid(0);
>         ignite.cluster().active(true);
>         IgniteCache<Integer, Integer> cache0 = ignite.getOrCreateCache(ccfg);
>         for (int i = 0; i < 5_000; i++)
>             cache0.put(i, i);
>         forceCheckpoint();
>         for (int i = 1_000; i < 4_000; i++)
>             cache0.remove(i);
>         forceCheckpoint();
>         stopAllGrids();
>     }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)