DB Stored index startup issue
bwallis42 Apr 9, 2013 8:12 AMI have a problem that I have simplified down to a relatively simple test case but before I report a bug I'd like to know if the configuration I'm using is valid or is it causing the problem. When I run the test I get one of three results at random. One is that the test runs fine, two is I get an exception for a lock timeout and the third is a null pointer exception (traces attached). The different errors occur at random.
The test case just does a repository login/logout.
I'm running a just updated 3.2-SNAPSHOT of modeshape and JDK 1.7.0_17. The two traces are attached as is a zip of the maven project with the test case in it.
This is the body of the test case.
{code}public class StartupTest
{
private static Logger log;
private Repository repository;
private ModeShapeEngine engine;
static {
BasicConfigurator.configure();
LogManager.getRootLogger().setLevel((Level) Level.INFO);
log = LoggerFactory.getLogger(StartupTest.class);
}
@Before
public void init()
throws Exception
{
log.info("Read repository configuration");
RepositoryConfiguration config = RepositoryConfiguration.read("DataRepository.json");
log.info("Start ModeShapeEngine");
engine = new ModeShapeEngine();
engine.start();
engine.deploy(config);
log.info("Get Repository");
repository = (Repository) engine.getRepository("DataRepository");
log.info("Have Repository "+repository);
}
@After
public void unInit()
throws Exception
{
log.info("Shutdown ModeShapeEngine");
Future<Boolean> result = engine.shutdown(true);
result.get(5, TimeUnit.SECONDS);
}
@Test(timeout=20000)
public void justLoginAndLogout() throws Exception
{
Session session=null;
try
{
log.info("Login to the repository");
session = repository.login();
log.info("Logged into the repository");
}
finally {
if(session != null)
{
log.info("logout from the repository");
session.logout();
log.info("Logged out from the repository");
}
}
}
}
{code}
The repository config file is
{code}{
"name" : "DataRepository",
"storage" : {
"cacheName" : "DataRepository",
"cacheConfiguration" : "src/test/resources/storage_cache_configuration.xml",
"transactionManagerLookup" : "org.infinispan.transaction.lookup.GenericTransactionManagerLookup",
"binaryStorage" : {
"type" : "file",
"directory" : "target/binary",
"minimumBinarySizeInBytes" : 4096
}
},
"query" : {
"enabled" : true,
"indexStorage" : {
"type" : "infinispan",
"cacheConfiguration" : "src/test/resources/query_cache_configuration.xml",
"lockCacheName" : "indexLocks",
"dataCacheName" : "indexData",
"metadataCacheName" : "indexMetadata",
"chunkSizeInBytes" : 1024
},
},
}
{code}
Storage cache configuration is
{code}<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
xmlns="urn:infinispan:config:5.1">
<global>
<globalJmxStatistics enabled="true" allowDuplicateDomains="true" />
</global>
<default>
</default>
<namedCache name="DataRepository">
<jmxStatistics enabled="true" />
<eviction strategy="LIRS" maxEntries="1000" />
<clustering mode="LOCAL" />
<invocationBatching enabled="true" />
<loaders passivation="false" shared="false" preload="false">
<loader class="org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore" fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false">
<properties>
<property name="stringsTableNamePrefix" value="DATA"/>
<property name="idColumnName" value="ID_COLUMN"/>
<property name="dataColumnName" value="DATA_COLUMN"/>
<property name="timestampColumnName" value="TIMESTAMP_COLUMN"/>
<property name="timestampColumnType" value="BIGINT"/>
<property name="connectionFactoryClass" value="org.infinispan.loaders.jdbc.connectionfactory.PooledConnectionFactory"/>
<property name="connectionUrl" value="jdbc:h2:mem:msdb;DB_CLOSE_DELAY=-1"/>
<property name="userName" value="sa"/>
<property name="driverClass" value="org.h2.Driver"/>
<property name="idColumnType" value="VARCHAR(255)"/>
<property name="dataColumnType" value="BLOB"/>
<property name="dropTableOnExit" value="true"/>
<property name="createTableOnStart" value="true"/>
</properties>
</loader>
</loaders>
<transaction
transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup"
transactionMode="TRANSACTIONAL" lockingMode="OPTIMISTIC" />
</namedCache>
</infinispan>
{code}
and the query cache configuration is
{code}<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
xmlns="urn:infinispan:config:5.1">
<global>
<globalJmxStatistics enabled="true"
allowDuplicateDomains="true" />
</global>
<default />
<namedCache name="indexLocks">
<jmxStatistics enabled="true" />
<clustering mode="LOCAL" />
<invocationBatching enabled="true" />
<transaction
transactionManagerLookupClass="org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup"
transactionMode="TRANSACTIONAL" lockingMode="OPTIMISTIC">
<recovery enabled="true" />
</transaction>
</namedCache>
<namedCache name="indexData">
<jmxStatistics enabled="true" />
<eviction strategy="LIRS" maxEntries="1000" />
<clustering mode="LOCAL" />
<invocationBatching enabled="true" />
<loaders passivation="false" shared="false" preload="false">
<loader class="org.infinispan.loaders.jdbc.binary.JdbcBinaryCacheStore" fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false">
<properties>
<property name="bucketTableNamePrefix" value="QUERY"/>
<property name="idColumnName" value="ID_COLUMN"/>
<property name="dataColumnName" value="DATA_COLUMN"/>
<property name="timestampColumnName" value="TIMESTAMP_COLUMN"/>
<property name="timestampColumnType" value="BIGINT"/>
<property name="connectionFactoryClass" value="org.infinispan.loaders.jdbc.connectionfactory.PooledConnectionFactory"/>
<property name="connectionUrl" value="jdbc:h2:mem:msdb;DB_CLOSE_DELAY=-1"/>
<property name="userName" value="sa"/>
<property name="driverClass" value="org.h2.Driver"/>
<property name="idColumnType" value="VARCHAR(255)"/>
<property name="dataColumnType" value="BLOB"/>
<property name="dropTableOnExit" value="true"/>
<property name="createTableOnStart" value="true"/>
</properties>
</loader>
</loaders>
<transaction
transactionManagerLookupClass="org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup"
transactionMode="TRANSACTIONAL" lockingMode="OPTIMISTIC">
<recovery enabled="true" />
</transaction>
</namedCache>
<namedCache name="indexMetadata">
<jmxStatistics enabled="true" />
<clustering mode="LOCAL" />
<invocationBatching enabled="true" />
<eviction strategy="LIRS" maxEntries="1000" />
<loaders passivation="false" shared="false" preload="false">
<loader class="org.infinispan.loaders.jdbc.binary.JdbcBinaryCacheStore" fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false">
<properties>
<property name="bucketTableNamePrefix" value="QUERY"/>
<property name="idColumnName" value="ID_COLUMN"/>
<property name="dataColumnName" value="DATA_COLUMN"/>
<property name="timestampColumnName" value="TIMESTAMP_COLUMN"/>
<property name="timestampColumnType" value="BIGINT"/>
<property name="connectionFactoryClass" value="org.infinispan.loaders.jdbc.connectionfactory.PooledConnectionFactory"/>
<property name="connectionUrl" value="jdbc:h2:mem:msdb;DB_CLOSE_DELAY=-1"/>
<property name="userName" value="sa"/>
<property name="driverClass" value="org.h2.Driver"/>
<property name="idColumnType" value="VARCHAR(255)"/>
<property name="dataColumnType" value="BLOB"/>
<property name="dropTableOnExit" value="true"/>
<property name="createTableOnStart" value="true"/>
</properties>
</loader>
</loaders>
<transaction
transactionManagerLookupClass="org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup"
transactionMode="TRANSACTIONAL" lockingMode="OPTIMISTIC">
<recovery enabled="true" />
</transaction>
</namedCache>
</infinispan>
{code}
-
Mode-YYYY.zip 13.8 KB
-
TimeoutTrace.txt.zip 3.2 KB
-
NullPointerTrace.txt.zip 1.9 KB