Closed JasonBarnabe closed 3 years ago
Hi Jason - I'm not quite sure why there's three - this could possibly be because of the association callbacks? - but there should certainly be at least one, marking the updated record as 'deleted' in the core
index only, to ensure only data from the delta
index is considered for search requests from that point onwards (until the next full re-index, which resets the deleted flags).
I'm not quite sure why there's three - this could possibly be because of the association callbacks?
From the test, looks like it's indeed coming from the associated objects. Is there a possibility of something going wrong (other than just wasting time) if things are fired multiple times? Some sort of race condition?
there should certainly be at least one
Good to know - I was having a problem in production and I thought this might be the cause. But I later found a delta.tmp file hanging around, and once I deleted that, things started working again.
Is there a possibility of something going wrong (other than just wasting time) if things are fired multiple times? Some sort of race condition?
I wouldn't think so. They're idempotent actions - they just mark a single record as deleted (from the perspective of Thinking Sphinx - the data remains in Sphinx, it's just filtered out in search requests). If it's already flagged as deleted, it'll stay that way. The only way that value changes back is when the index is reprocessed via ts:index
.
Thanks!
When I do an update in production, I see 3
ThinkingSphinx::Deltas::SidekiqDelta::FlagAsDeletedJob
s happening. (There are no database deletes involved in the update action.) Is this normal?I've created a test that demonstrates it - https://github.com/JasonBarnabe/greasyfork/pull/821/files