|
From: <ben...@jb...> - 2006-06-28 13:16:47
|
"bst...@jb..." wrote :
| 2 Person objects, with a shared reference to an Address. Using buddy replication.
|
| 1 Person is placed in Cache 1 under "/husband" then the other is placed in Cache 1 under "/wife". The address is stored in "/husband/address" -- "/wife/address" just has an indirect pointer to "/husband/address".
|
| Cache 1 dies. User fails over to Cache 2.
|
| 1) User calls getObject("/wife").
| 2) This causes node's "/wife" and "/wife/address" to gravitate.
| 3) User call wife.getAddress().
| 4) JBCACHE-669 is fixed, so this causes "/_JBossInternal_/_RefMap_/husband_address" to gravitate.
| 5) PojoCache deferences and follows the RefMap entry to "/husband/address", so node "/husband/address" is gravitated.
| 6) Gravitating "/husband/address" *does not cause the data map of "/husband" to gravitate*!!! Rather, Cache 2 just creates an empty node at "/husband" to maintain the tree structure.
| 7) User calls getObject("/husband"). This returns null, because node "/husband" does not have any data. No data gravitation is performed, because the "/husband" node *exists* in Cache 2.
|
| The fundamental problem here is the intermingling of the TreeCache structure with the storage of data. You can't access the Address object without involving the concept of "husband", which leads to all sorts of problems.
|
| BTW, I don't think this particular issue has to be fixed for 1.4.0 -- we could just say BR is for plain cache operations. However, JBCACHE-669 does need to be fixed, as FIELD replication does not work correctly without it.
Brian, I have thought about this issue while designing the new mapping scheme. While the scenario that you mentioned can happen, I think it is more unlikely. The reason being that buddy replication requires "sticky session" to operate in cases like http session repl.
If it is http session repl, then every data structure will be stored under a sessionID. In this case, my undertanding is we will gravitate everything under sessionID in one shot during failover, am I correct. Therefore, shared reference between "joe" and "mary" will still work, for example.
Using a flat mapping on the other hand, will require, during gravitation, the special need to gravitate the corresponding _JBoss_Internal_ area (since everything is stored in the internal flat heap now). In essence, we will need to walk the object graph.
For example, I am thinking what will be the best behavior for data gravitation, if after failover I do a:
| joe = getAttribute("joe", joe);
| joe.getName();
|
should we also gravitate the corresponding address field as well. Or just lazily gravitate it when needed? E.g., when
| joe.getAddress().setCity("Taipei");
|
is called?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3954000#3954000
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3954000
|