On Nov 12, 11:45 am, "I. E. Smith-Heisters" <[email protected]> wrote:
> Hi folks, John,
>
> I'm trying to migrate to a composite storage using CouchDB for history
> and workitems, and Redis for everything else. It's been working great
> in testing. I implemented some monkey patches to CompositeStorage,
> partly to get it to work with other enhancements, but also because
> there were some bugs in #add_type (ie. it didn't exist), #delete, and
> #reservehttps://gist.github.com/570681#file_ruote_couch_ext.rb.
>
> With that done, I started working on migrating data from CouchDB to
> Redis. My migration script is based 
> onhttp://groups.google.com/group/openwferu-users/browse_thread/thread/8...,
> but works around StorageBase#copy_to because I didn't want to copy all
> types of data. Here's the migration:https://gist.github.com/674557
>
> Unfortunately, after this is run, I get this 
> error:https://gist.github.com/674562
>
> Printing the `scheds` that are passed to StorageBase#filter_schedules,
> I see that the schedules in my original CouchDB database look like:
>
> [{"msg"=>{<msg hash>}}]
>
> while the migrated data looks like:
>
> [1, 1, {"msg"=>{<msg hash>}}]
>
> Seems likely to be the cause of the problem. Any thoughts on this? A
> problem with the Redis storage backend perhaps?

Digging into the ruote-redis code, get_many is pulling out the
revision key along with the document keys with `keys = "#{type}/*"`.
The revision key is "schedules/at-0_1_0!0466902073001!20101112-
bogafuhetzu-20101119192248", and the actual schedule is at "schedules/
at-0_1_0!0466902073001!20101112-bogafuhetzu-20101119192248/1", which
are both caught by that wildcard key.

The unit tests pass, but they don't appear to cover this scenario.
Adding a test for fetching schedule-type records, I get this a
failure: https://gist.github.com/674815.

Unfortunately, I'm unclear why get_many treats schedules and msgs
differently. It also seems like this would be a pretty obvious bug, so
I suspect that I have something misconfigured on my side.

-- 
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en

Reply via email to