Fixed bug where a node deleted by replication was left in the cache via secondary
key without being marked as invalid. (bug 147)
This commit is contained in:
parent
6266b3b5b7
commit
20402accfa
1 changed files with 8 additions and 4 deletions
|
@ -171,7 +171,7 @@ public final class NodeManager {
|
||||||
deleteNode (db, tx.txn, node);
|
deleteNode (db, tx.txn, node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1197,7 +1197,8 @@ public final class NodeManager {
|
||||||
*/
|
*/
|
||||||
public void replicateCache (Vector add, Vector delete) {
|
public void replicateCache (Vector add, Vector delete) {
|
||||||
if (logReplication)
|
if (logReplication)
|
||||||
app.logEvent ("Received cache replication event: "+add.size()+" added, "+delete.size()+" deleted");
|
app.logEvent ("Received cache replication event: "+add.size()+
|
||||||
|
" added, "+delete.size()+" deleted");
|
||||||
synchronized (cache) {
|
synchronized (cache) {
|
||||||
for (Enumeration en=add.elements(); en.hasMoreElements(); ) {
|
for (Enumeration en=add.elements(); en.hasMoreElements(); ) {
|
||||||
Node n = (Node) en.nextElement ();
|
Node n = (Node) en.nextElement ();
|
||||||
|
@ -1210,14 +1211,17 @@ public final class NodeManager {
|
||||||
cache.put (n.getKey(), n);
|
cache.put (n.getKey(), n);
|
||||||
}
|
}
|
||||||
for (Enumeration en=delete.elements(); en.hasMoreElements(); ) {
|
for (Enumeration en=delete.elements(); en.hasMoreElements(); ) {
|
||||||
|
// NOTE: it would be more efficient to transfer just the keys
|
||||||
|
// of nodes that are to be deleted.
|
||||||
Node n = (Node) en.nextElement ();
|
Node n = (Node) en.nextElement ();
|
||||||
DbMapping dbm = app.getDbMapping (n.getPrototype ());
|
DbMapping dbm = app.getDbMapping (n.getPrototype ());
|
||||||
if (dbm != null)
|
if (dbm != null)
|
||||||
dbm.notifyDataChange ();
|
dbm.notifyDataChange ();
|
||||||
n.setDbMapping (dbm);
|
n.setDbMapping (dbm);
|
||||||
n.nmgr = safe;
|
n.nmgr = safe;
|
||||||
cache.put (n.getKey(), n);
|
Node oldNode = (Node) cache.get (n.getKey());
|
||||||
evictNode (n);
|
if (oldNode != null)
|
||||||
|
evictNode (oldNode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue