Chaining ClusteredCacheGetCommand and JDBCCacheLoader
by Yong Yuan
Hi,
I have two servers, server A and server B, each running a JBoss cache
instance. Server A uses server B as a far cache. The cache instance on
server B also uses a database as a persistent cache store. Server A has
ClusteredCacheLoader as its only loader, and server B has
ClusteredCacheLoader as its first loader and JDBCCacheLoader as its second
loader. My question is, Can server A get a cached state that is *only* in
the persistent cache store? Below is the flow I imagined:
get cached state
calls ClusteredCacheLoader calls
JDBCCacheLoader
Server A ----------------------------> cache instance on server A
----------------------------------------> cache instance on server B
------------------------------------> persistent cache store
I'm asking this question because I noticed when a cache state was only in
persistent cache store, server A would not be able to get that state. I
turned on the traces on both servers. The log on server A showed
ClusteredCacheLoader did make a remote call with ClusteredGetCommand and
correct fqn being sent to server B. The log on server B showed that server B
did receive the remote call from server A. Server B then executed
ClusteredGetCommand, which in turn executed ExistsCommand first and then
GetDataMapCommand. Since the requested cache was not in the memory, both
commands returned false or null. Unfortunately, the chain execution ended
here. No JDBC call was issued after GetDataMapCommand returned [false, null]
to server A. As a result, server A always got null instead of the state in
the persistent store.
Can I update my configuration files to enable command chaining or something
familiar? That is, when ClusteredGetCommand in server B doesn't get anything
from memory, JDBCCacheLoader will be executed to get the data from database.
Or some customization is needed here? By the way, CommandAwareRpcDispatcher
said ClusteredGetCommand ".. is a non-visitable command - so performing
directly and not via the invoker.", so somehow interceptor chaining was
bypassed.
Any suggestion is greatly appreciated.
Thanks,
Yong
15 years
ClusteredCacheLoader doesn't retrieve cached state after server is restarted
by Yong Yuan
Hi,
I have two servers that use JBoss Cache 3.0.3. Each server is configured to
replicate its states to the other. The bigger server has more memory and
thus contains most of the cache states, while the smaller server uses a
ClusteredCacheLoader to get cached states if it can't find them in its own
cache instance:
Smaller server -> a cache instance
||
|| using ClusteredCacheLoader to get cached state
\\ //
Bigger server -> a cache instance
The problem is, the ClusteredCacheLoader never retrieved any cached state.
Turning on trace, I found that ClusteredCacheLoader always returned null if
cache mode was asynchronous replication and there was at least one
serialization executor. Therefore, I set serializationExecutorPoolSize to 0.
This time, ClusteredCacheLoader did attempt to send out remote request, but
it ended up getting a replication exception in the response, as the
following log shows:
(CommandAwareRpcDispatcher.java:291) 2009-04-22 19:47:50,151 TRACE
responses: [sender=10.210.102.104:45592, retval=[true, false],
received=true, suspected=false]
[sender=10.210.102.104:37132, retval=null, received=false, suspected=false]
The bigger server didn't have any exception logged, though.
Any suggestion how I should solve this problem? Thanks a lot!
15 years