[infinispan-issues] [JBoss JIRA] (ISPN-5596) "Cannot clear data directory" in SoftIndexFileStore when clear() is called after stopping and restarting cache
Andreas Pabst (JIRA)
issues at jboss.org
Tue Aug 4 12:57:02 EDT 2015
[ https://issues.jboss.org/browse/ISPN-5596?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andreas Pabst updated ISPN-5596:
--------------------------------
Steps to Reproduce: run test case from attached file which basically repeatedly clears the cache, fills it, stops it and restarts it. (was: public class SoftIndexCacheStoreTest {
public static final EmbeddedCacheManager MANAGER = new DefaultCacheManager();
public static void main(String args[]) throws Exception {
Cache<Integer, String> testCache = createCache();
clearFillStopAndStartAgain(testCache);
clearFillStopAndStartAgain(testCache);
testCache.stop();
MANAGER.stop();
}
private static void clearFillStopAndStartAgain(Cache<Integer, String> testCache) {
System.out.println("cache status: " + testCache.getStatus());
testCache.clear();
for (int i = 0; i < 100; i++) {
testCache.put(i, "the value for " + i);
}
testCache.stop();
System.out.println("cache status: " + testCache.getStatus());
testCache.start();
}
private static Cache<Integer, String> createCache() {
System.out.println("Defining cache config");
MANAGER.defineConfiguration("soft-index-test-cache", new ConfigurationBuilder()
.persistence().addStore(SoftIndexFileStoreConfigurationBuilder.class)
.indexLocation("soft-index-test/index").dataLocation("soft-index-test/data")
.eviction().strategy(EvictionStrategy.LRU).maxEntries(50L)
.build());
System.out.println("Getting cache");
return MANAGER.getCache("soft-index-test-cache");
}
}
)
> "Cannot clear data directory" in SoftIndexFileStore when clear() is called after stopping and restarting cache
> --------------------------------------------------------------------------------------------------------------
>
> Key: ISPN-5596
> URL: https://issues.jboss.org/browse/ISPN-5596
> Project: Infinispan
> Issue Type: Bug
> Components: Loaders and Stores
> Affects Versions: 7.2.3.Final
> Environment: Windows 7
> Reporter: Andreas Pabst
> Assignee: Radim Vansa
> Attachments: SoftIndexFileStoreTest.java, test.log
>
>
> When stopping and restarting a cache with SoftIndexFileStore persistence, it behaves strangely.
> Calling cache.clear() leads to the following exception:
> ERROR: ISPN000136: Execution error
> org.infinispan.persistence.spi.PersistenceException: Cannot clear data directory!
> at org.infinispan.persistence.sifs.SoftIndexFileStore.clear(SoftIndexFileStore.java:234)
> at org.infinispan.persistence.manager.PersistenceManagerImpl.clearAllStores(PersistenceManagerImpl.java:372)
> at org.infinispan.interceptors.CacheWriterInterceptor.visitClearCommand(CacheWriterInterceptor.java:158)
> ...
> Caused by: java.io.IOException: Cannot delete file soft-index-test\data\2
> at org.infinispan.persistence.sifs.FileProvider.clear(FileProvider.java:205)
> at org.infinispan.persistence.sifs.SoftIndexFileStore.clear(SoftIndexFileStore.java:232)
> If the manager is also stopped and recreated every time, this only happens after the third iteration.
> Calling cache.remove() in the same place leads to an unrecoverable corruption of the cache store files: java.lang.IllegalArgumentException: Negative position
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
More information about the infinispan-issues
mailing list