[JBoss JIRA] Created: (JBCACHE-1495) the searchable cache indexes are not updated if there were data manipulation in transaction or batch
by Yan Falken (JIRA)
the searchable cache indexes are not updated if there were data manipulation in transaction or batch
-----------------------------------------------------------------------------------------------------
Key: JBCACHE-1495
URL: https://jira.jboss.org/jira/browse/JBCACHE-1495
Project: JBoss Cache
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: SearchableCache
Environment: searchable cache version 1.0.0 GA
Reporter: Yan Falken
Assignee: Manik Surtani
Priority: Blocker
// runnable unit test:
package problems;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.ProvidedId;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.Store;
import org.jboss.cache.*;
import org.jboss.cache.loader.jdbm.JdbmCacheLoaderConfig;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.search.SearchableCacheFactory;
import org.jboss.cache.search.SearchableCache;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeMethod;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.index.Term;
import static org.testng.AssertJUnit.*;
import java.util.Properties;
import java.io.Serializable;
@Test(groups = {"unit"}, sequential = true)
public class IndexingInTransaction {
private static final Fqn fname = Fqn.fromString("blah");
private Cache coreCache;
private SearchableCache searchableCache;
Node node;
public IndexingInTransaction() {
init();
}
@BeforeMethod
public void init() {
CacheFactory factory = new DefaultCacheFactory();
Configuration c = new Configuration();
c.setInvocationBatchingEnabled(true);
CacheLoaderConfig clc = new CacheLoaderConfig();
JdbmCacheLoaderConfig jclc = new JdbmCacheLoaderConfig();
jclc.setAsync(false);
jclc.setFetchPersistentState(false);
jclc.setIgnoreModifications(false);
jclc.setPurgeOnStartup(true);
jclc.setLocation("/tmp/c1");
clc.addIndividualCacheLoaderConfig(jclc);
c.setCacheLoaderConfig(clc);
coreCache = factory.createCache(c, false);
SearchableCacheFactory f = new SearchableCacheFactory();
Properties p = new Properties();
p.put("hibernate.search.default.indexBase", "/tmp/c1idx");
searchableCache = f.createSearchableCache(coreCache, p, Entity.class);
searchableCache.create();
searchableCache.start();
node = searchableCache.getRoot().addChild(fname);
}
@Test
public void testPutEntitiesWithoutTransaction() {
for (int i = 1; i <= 10; i++) {
Entity e = getEntity(i);
System.out.println("caching: " + e);
Node c = node.addChild(Fqn.fromString(e.getName()));
c.put(""+ e.getId(), e);
}
assertFalse(searchableCache.createQuery(
Entity.searchByName("Name5")).list().isEmpty());
}
@Test
public void testPutEntitiesWithTransaction() throws Exception {
((CacheSPI)(coreCache)).getTransactionManager().begin();
for (int i = 11; i <= 20; i++) {
Entity e = getEntity(i);
System.out.println("caching: " + e);
Node c = node.addChild(Fqn.fromString(e.getName()));
c.put(""+ e.getId(), e);
}
((CacheSPI)(coreCache)).getTransactionManager().commit();
assertFalse(searchableCache.createQuery(
Entity.searchByName("Name15")).list().isEmpty());
}
Entity getEntity(long id) {
return new Entity(id, "Name" + id, "Surname" + id, true);
}
// public static void main(String[] args) {
// IndexingInTransaction stb = new IndexingInTransaction();
// stb.init();
// }
}
@ProvidedId
@Indexed
class Entity implements Serializable {
public static final String IDX_NAME = "name";
public static final String IDX_SURNAME = "surname";
private long id;
@Field(store = Store.YES)
private String name;
@Field (store = Store.YES)
private String surname;
private boolean dead;
Entity(long id, String name, String surname, boolean dead) {
this.id = id;
this.name = name;
this.surname = surname;
this.dead = dead;
}
public long getId() {
return id;
}
public String getName() {
return name;
}
public String getSurname() {
return surname;
}
public boolean isDead() {
return dead;
}
public static Query searchByName(String name) {
BooleanQuery query = new BooleanQuery();
query.add(new TermQuery(
new Term(Entity.IDX_NAME,
name.toLowerCase())),
BooleanClause.Occur.MUST);
return query;
}
@Override
public String toString() {
return "Entity{" +
"id=" + id +
", name='" + name + '\'' +
", surname='" + surname + '\'' +
", dead=" + dead +
'}';
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 5 months
[JBoss JIRA] Created: (JBCACHE-1432) Cache corrupted by 64bit windows member
by Bill Middleton (JIRA)
Cache corrupted by 64bit windows member
---------------------------------------
Key: JBCACHE-1432
URL: https://jira.jboss.org/jira/browse/JBCACHE-1432
Project: JBoss Cache
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Cache loaders
Affects Versions: 2.2.1.CR1
Environment: Windows 64bit OS with either 32 or 64bit jvm
in cluster with any linux OS (32 or 64bit) with any linux jvm.
Reporter: Bill Middleton
Assignee: Manik Surtani
Fix For: 3.1.0
Hello. We've run into some trouble in attempting to bring a 64bit windows machine into an existing cluster. The cluster has (had) two 64bit linux members and was running fine when we attempted to insert a 64bit windows machine into the cluster. Anytime the 64bit windows machine wrote a node, the node was thereafter unreadable by either of the original cluster members. Exceptions of the following form were thrown by the other members (will attach stacktrace as comment)
I attempted to get help on this issue in the user forum, but it seems that nobody else is running 64bit windows as a cluster member with other OS's in the cluster. I hope perhaps someone can at least confirm this now formally?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 5 months
[JBoss JIRA] Created: (JBCACHE-1504) Activation of a passivated node can remove parents from cache loader
by Krzysztof Sobolewski (JIRA)
Activation of a passivated node can remove parents from cache loader
--------------------------------------------------------------------
Key: JBCACHE-1504
URL: https://jira.jboss.org/jira/browse/JBCACHE-1504
Project: JBoss Cache
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Cache loaders, Eviction
Affects Versions: 3.1.0.CR1
Reporter: Krzysztof Sobolewski
Assignee: Manik Surtani
The test (attached) performs the following steps:
1a) put(/a/a/a, x, x)
1b) put(/a/a, x, x)
2) evict(/a, true)
3) put(/a/a/a, x, y)
3a) ActivationInterceptor removes /a/a/a from cache loader and parents (if also loaded)
4) test that get(/a/a, x) is not null fails
The thing is that during step 3 the node (/a/a/a) gets loaded; this also needs to create its parent (/a/a) because it too was evicted. The parent is created empty (not loaded) but it has a flag DATA_LOADED set, so during the following step 3a its data gets removed too, because ActivationInterceptor thinks it's safe to do that.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 5 months
[JBoss JIRA] Created: (JBCACHE-1476) TransactionLog generates spurious ERROR logs on read-only transactions
by Krzysztof Sobolewski (JIRA)
TransactionLog generates spurious ERROR logs on read-only transactions
----------------------------------------------------------------------
Key: JBCACHE-1476
URL: https://jira.jboss.org/jira/browse/JBCACHE-1476
Project: JBoss Cache
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Transactions
Affects Versions: 3.0.2.GA
Reporter: Krzysztof Sobolewski
Assignee: Manik Surtani
Attachments: TransactionLogTest.patch
We're testing our internal component with JBoss Cache 3.x and we noticed lots of ERROR logs from TransactionLog like this one:
2009-02-11 13:47:49,773 ERROR [org.jboss.cache.transaction.TransactionLog] (main) Could not find matching prepare for commit: GlobalTransaction:<192.168.1.18:7900>:3
It turns out that these logs are harmless and happen only on transactions that are committed without doing any writes (i.e. read-only transactions). Even though it's mostly harmless, it's annoying, hence this bug.
I'm going to attach a patch with a test case, which modifies the log4j configuration and adds a "deadly" appender to TransactionLog's logger to demonstrate the issue (it's a little bit funny...)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 5 months