freelancing-god/thinking-sphinx — Issue #305: Delta rotate updates all user records killing persistence token
Author: jdutil
Created: 2011-11-11 23:51:12+00:00
State: open

I'm experiencing a weird issue with my sphinx setup in my staging environment where every couple minutes my cronjob runs a reindex and during the delta rotation every user record is updated changing their persistence token. This causes all user sessions with authlogic to be terminated due to the changed persistence token.

I haven't been able to figure out a way to fix this or exactly why it occurs other than that it happens during the user index rotation. I was on version 2.0.5 and have upgraded to 2.0.10 but that doesn't resolve the issue. What's very strange is my production environment runs fine, and doesn't experience this issue with identical server configuration / gemfile. We can't upgrade production until we solve this issue to ensure it doesn't start happening on our production server.

Any help tracking down the cause or solution would be greatly appreciated.

I don't understand exactly why the reindexing would cause all user records to be updated, and change their persistence token.

Shouldn't the delta attribute be the only attribute updated on the user records when the reindex occurs?

Perhaps the Authlogic is causing the persistence token to also update during the delta attribute update for some unknown reason? I've tried both the latest Authlogic 3.0.3 and 3.1.0, but that hasn't fixed the issue either.