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
|
@ -1197,7 +1197,8 @@ public final class NodeManager {
|
|||
*/
|
||||
public void replicateCache (Vector add, Vector delete) {
|
||||
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) {
|
||||
for (Enumeration en=add.elements(); en.hasMoreElements(); ) {
|
||||
Node n = (Node) en.nextElement ();
|
||||
|
@ -1210,14 +1211,17 @@ public final class NodeManager {
|
|||
cache.put (n.getKey(), n);
|
||||
}
|
||||
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 ();
|
||||
DbMapping dbm = app.getDbMapping (n.getPrototype ());
|
||||
if (dbm != null)
|
||||
dbm.notifyDataChange ();
|
||||
n.setDbMapping (dbm);
|
||||
n.nmgr = safe;
|
||||
cache.put (n.getKey(), n);
|
||||
evictNode (n);
|
||||
Node oldNode = (Node) cache.get (n.getKey());
|
||||
if (oldNode != null)
|
||||
evictNode (oldNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue