Hi,
This is a discussion Galder and I started on the irc.
We son't currently have a well defined policy for what happens when
fetchPersistentState="true" and the node that receives state already has some
data in it, that might overlap with remotely received data.
Most of the loaders right now do a clear() now, before integrating any data. This is not
done by all the loaders: JdbmCacheStore, BdbjeCacheStore override this.
So some of the loaders do a mirror of the data(first they empty the store), some do an
override.
Mirror might make sense in at least one scenario: you have a cluster running, each node
having it's own local store. One node goes down and, after a while you re-start it.
This new node will integrate the persistent state of the others, and entries might have
been deleted in between (while the node was down). now, if these deleted entries are in
new joiner's store, this would mean data inconsistency.
So I think we should:
- clearly define what happens with the existing data in the cache store during
fetchPersistentState
- if we decide to clear it before fetchPersistentState, we should call store.clear() from
StateTransferManager and not from particular cache store implementation, as this is error
prone
- we can even use a configurable strategy, e.g. fetchPersistentState="none"
fetchPersistentState="override" fetchPersistentState="mirror"
Cheers,
Mircea