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

Nikolay Izhikov commented on IGNITE-12254:
------------------------------------------

LGTM

> IO errors during write header of WAL files in FSYNC mode should be handled by 
> failure handler
> ---------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-12254
>                 URL: https://issues.apache.org/jira/browse/IGNITE-12254
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Aleksey Plekhanov
>            Assignee: Aleksey Plekhanov
>            Priority: Blocker
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Currently, such errors can hang the cluster.
> Reproducer:
> {code:java}
>     @Test
>     public void testWalFsyncIOError() throws Exception {
>         cleanPersistenceDir();
>         IgniteConfiguration cfg = new IgniteConfiguration();
>         cfg.setCacheConfiguration(new 
> CacheConfiguration(DEFAULT_CACHE_NAME).setAtomicityMode(ATOMIC));
>         cfg.setDataStorageConfiguration(
>             new DataStorageConfiguration()
>                 .setDefaultDataRegionConfiguration(
>                     new DataRegionConfiguration()
>                         .setMaxSize(100L * 1024 * 1024)
>                         .setPersistenceEnabled(true))
>                 .setWalMode(WALMode.FSYNC)
>                 .setWalSegmentSize(512 * 1024)
>                 .setWalBufferSize(512 * 1024));
>         IgniteEx ignite0 = startGrid(new 
> IgniteConfiguration(cfg).setIgniteInstanceName("ignite0"));
>         IgniteEx ignite1 = startGrid(new 
> IgniteConfiguration(cfg).setIgniteInstanceName("ignite1"));
>         ignite0.cluster().active(true);
>         IgniteCache cache = ignite0.cache(DEFAULT_CACHE_NAME);
>         for (int i = 0; i < 1_000; i++)
>             cache.put(i, "Test value " + i);
>         
> ((FileWriteAheadLogManager)ignite1.context().cache().context().wal()).setFileIOFactory(new
>  FileIOFactory() {
>             FileIOFactory delegateFactory = new RandomAccessFileIOFactory();
>             @Override public FileIO create(File file, OpenOption... modes) 
> throws IOException {
>                 final FileIO delegate = delegateFactory.create(file, modes);
>                 return new FileIODecorator(delegate) {
>                     @Override public int write(ByteBuffer srcBuf) throws 
> IOException {
>                         throw new IOException("No space left on device");
>                     }
>                 };
>             }
>         });
>         for (int i = 0; i < 2_000; i++)
>             try {
>                 cache.put(i, "Test value " + i);
>             }
>             catch (Exception ignore) {
>             }
>     }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to