[infinispan-dev] Migration of data between cache stores

Mircea Markus mmarkus at redhat.com
Fri Sep 20 06:36:46 EDT 2013


On Sep 19, 2013, at 8:24 AM, Galder Zamarreño <galder at redhat.com> wrote:

> Hi all,
> 
> Re: https://issues.jboss.org/browse/ISPN-3318
> Re: https://docs.jboss.org/author/display/ISPN/Rolling+upgrades
> 
> I've been thinking about this migration stuff, and I came to the conclusion that for anyone that wants to migrate cache store data and are using Hot Rod or REST, they should use existing rolling upgrade system. That'll give them the ability directly (thanks to cache.keySet() returning keys in cache store) to fetch all data from the cache store, in the old format, and be able to apply to new cluster, in new format, without the need of extra code to deal with cache store lower level details.
> 
> The big question is though, how to migrate cache store data for those embedded caches. If you extrapolate what I said above, the question might really be: how to do rolling upgrades of embedded/library mode caches. 
> 
> The main problem here is that you could think of configuring the target cluster with cache store details of the source cluster, but this won't work: Infinispan 6.0 cannot read Infinispan 5.x cache stores. All the classes and formats for Infinispan 5.x are gone from the source code in Infinispan 6.0. 
> 
> There's three ways to resolve this:
> 
> a) Bring back Infinispan 5.x classes to 6.0 to be able to read 5.x cache stores directly from 6.0.

that would also require logic in the stores to verify the types internally, very complicated...

> b) Develop some code for Infinispan 5.x to dump cache store data into a file or somewhere in a given format and then read that from 6.0.
> c) Use CLI to connect from new cluster to the old cluster and fetch all keys.
> 
> I think the easiest thing would be to do c), developing a CLISourceMigrator (implements org.infinispan.upgrade.SourceMigrator) to be able to read all keys from the source embedded cluster. However, I don't see anywhere in the CLI a command that returns back all keys. Upgrade with DUMPKEYS simply calls up the local SourceMigrator.recordKnownGlobalKeyset. We'd need such a command in Infinispan 5.x and 6.x, the former to send all keys and the latter to request them.

Sounds good to me. Also having a CLI command to return all the keys is generally useful.


> 
> We'd also need a CLITargetMigrator which is pretty straightforward to do since once we have all keys, it's easy to loop through them and request them using CLI's Get operation.
> 
> @Tristan, you're the rolling upgrade meister, how does this sound? If we get this right, we'd not only get cache store migration, but also embedded/library cluster rolling upgrade.
> 
> Cheers,
> --
> Galder Zamarreño
> galder at redhat.com
> twitter.com/galderz
> 
> Project Lead, Escalante
> http://escalante.io
> 
> Engineer, Infinispan
> http://infinispan.org
> 
> 
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

Cheers,
-- 
Mircea Markus
Infinispan lead (www.infinispan.org)







More information about the infinispan-dev mailing list